pub trait FromUserAgentInfo: Sized {
// Required methods
fn parse_client_hints(client_hints: &ClientHints<&str>) -> Option<Self>;
fn parse_user_agent(user_agent: &str) -> Option<Self>;
// Provided method
fn from_hints_or_ua(raw_info: &RawUserAgentInfo<&str>) -> Option<Self> { ... }
}
Expand description
Computes a Context
from either a user agent string and client hints.
Required Methods§
Sourcefn parse_client_hints(client_hints: &ClientHints<&str>) -> Option<Self>
fn parse_client_hints(client_hints: &ClientHints<&str>) -> Option<Self>
Tries to populate the context from client hints.
Sourcefn parse_user_agent(user_agent: &str) -> Option<Self>
fn parse_user_agent(user_agent: &str) -> Option<Self>
Tries to populate the context from a user agent header string.
Provided Methods§
Sourcefn from_hints_or_ua(raw_info: &RawUserAgentInfo<&str>) -> Option<Self>
fn from_hints_or_ua(raw_info: &RawUserAgentInfo<&str>) -> Option<Self>
Tries to populate the context from client hints or a user agent header string.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.