pub struct ClientHints<S>{
pub sec_ch_ua_platform: Option<S>,
pub sec_ch_ua_platform_version: Option<S>,
pub sec_ch_ua: Option<S>,
pub sec_ch_ua_model: Option<S>,
}
Expand description
The client hint variable names mirror the name of the “SEC-CH” headers.
See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers#user_agent_client_hints
Fields§
§sec_ch_ua_platform: Option<S>
The client’s OS, e.g. macos, android…
sec_ch_ua_platform_version: Option<S>
The version number of the client’s OS.
sec_ch_ua: Option<S>
Name of the client’s web browser and its version.
sec_ch_ua_model: Option<S>
Device model, e.g. samsung galaxy 3.
Implementations§
source§impl<S> ClientHints<S>
impl<S> ClientHints<S>
source§impl ClientHints<String>
impl ClientHints<String>
sourcepub const SEC_CH_UA_PLATFORM: &'static str = "SEC-CH-UA-Platform"
pub const SEC_CH_UA_PLATFORM: &'static str = "SEC-CH-UA-Platform"
Provides the platform or operating system on which the user agent is running.
For example: "Windows"
or "Android"
.
Sec-CH-UA-Platform
is a low entropy hint. Unless blocked by a user agent permission
policy, it is sent by default (without the server opting in by sending Accept-CH
).
sourcepub const SEC_CH_UA_PLATFORM_VERSION: &'static str = "SEC-CH-UA-Platform-Version"
pub const SEC_CH_UA_PLATFORM_VERSION: &'static str = "SEC-CH-UA-Platform-Version"
Provides the version of the operating system on which the user agent is running.
sourcepub const SEC_CH_UA: &'static str = "SEC-CH-UA"
pub const SEC_CH_UA: &'static str = "SEC-CH-UA"
Provides the user agent’s branding and significant version information.
A brand is a commercial name for the user agent like: Chromium, Opera, Google Chrome,
Microsoft Edge, Firefox, and Safari. A user agent might have several associated brands. For
example, Opera, Chrome, and Edge are all based on Chromium, and will provide both brands in
the Sec-CH-UA
header.
The significant version is the “marketing” version identifier that is used to distinguish between major releases of the brand. For example a Chromium build with full version number “96.0.4664.45” has a significant version number of “96”.
The header may include “fake” brands in any position and with any name. This is a feature designed to prevent servers from rejecting unknown user agents outright, forcing user agents to lie about their brand identity.
Sec-CH-UA
is a low entropy hint. Unless blocked by a user agent permission policy, it is
sent by default (without the server opting in by sending Accept-CH
).
sourcepub const SEC_CH_UA_MODEL: &'static str = "SEC-CH-UA-Model"
pub const SEC_CH_UA_MODEL: &'static str = "SEC-CH-UA-Model"
Indicates the device model on which the browser is running.
sourcepub fn as_deref(&self) -> ClientHints<&str>
pub fn as_deref(&self) -> ClientHints<&str>
Returns an instance of ClientHints
that borrows from the original data.
Trait Implementations§
source§impl<S> Clone for ClientHints<S>
impl<S> Clone for ClientHints<S>
source§fn clone(&self) -> ClientHints<S>
fn clone(&self) -> ClientHints<S>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<S> Debug for ClientHints<S>
impl<S> Debug for ClientHints<S>
source§impl<S> Default for ClientHints<S>
impl<S> Default for ClientHints<S>
source§fn default() -> ClientHints<S>
fn default() -> ClientHints<S>
source§impl<'de, S> Deserialize<'de> for ClientHints<S>
impl<'de, S> Deserialize<'de> for ClientHints<S>
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl<S> PartialEq for ClientHints<S>
impl<S> PartialEq for ClientHints<S>
source§impl<S> Serialize for ClientHints<S>
impl<S> Serialize for ClientHints<S>
impl<S> StructuralPartialEq for ClientHints<S>
Auto Trait Implementations§
impl<S> Freeze for ClientHints<S>where
S: Freeze,
impl<S> RefUnwindSafe for ClientHints<S>where
S: RefUnwindSafe,
impl<S> Send for ClientHints<S>where
S: Send,
impl<S> Sync for ClientHints<S>where
S: Sync,
impl<S> Unpin for ClientHints<S>where
S: Unpin,
impl<S> UnwindSafe for ClientHints<S>where
S: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more