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.
Object Safety§
This trait is not object safe.