relay_event_normalization::user_agent

Trait FromUserAgentInfo

Source
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§

Source

fn parse_client_hints(client_hints: &ClientHints<&str>) -> Option<Self>

Tries to populate the context from client hints.

Source

fn parse_user_agent(user_agent: &str) -> Option<Self>

Tries to populate the context from a user agent header string.

Provided Methods§

Source

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.

Implementations on Foreign Types§

Source§

impl FromUserAgentInfo for BrowserContext

Source§

fn parse_client_hints(client_hints: &ClientHints<&str>) -> Option<Self>

Source§

fn parse_user_agent(user_agent: &str) -> Option<Self>

Source§

impl FromUserAgentInfo for DeviceContext

Source§

fn parse_client_hints(client_hints: &ClientHints<&str>) -> Option<Self>

Source§

fn parse_user_agent(user_agent: &str) -> Option<Self>

Source§

impl FromUserAgentInfo for OsContext

Source§

fn parse_client_hints(client_hints: &ClientHints<&str>) -> Option<Self>

Source§

fn parse_user_agent(user_agent: &str) -> Option<Self>

Implementors§