[][src]Struct uaparser::UserAgentParser

pub struct UserAgentParser { /* fields omitted */ }

Handles the actual parsing of a user agent string by delegating to the respective SubParser

Implementations

impl UserAgentParser[src]

pub fn from_yaml(path: &str) -> Result<UserAgentParser, Error>[src]

Attempts to construct a UserAgentParser from the path to a file

pub fn from_bytes(bytes: &[u8]) -> Result<UserAgentParser, Error>[src]

Attempts to construct a UserAgentParser from a slice of raw bytes. The intention with providing this function is to allow using the include_bytes! macro to compile the regexes.yaml file into the the library by a consuming application.

let regexes = include_bytes!("../../src/core/regexes.yaml");
let parser = UserAgentParser::from_bytes(regexes);

pub fn from_file(file: File) -> Result<UserAgentParser, Error>[src]

Attempts to construct a UserAgentParser from a reference to an open File. This File should be a the regexes.yaml depended on by all the various implementations of the UA Parser library.

pub fn try_from(regex_file: RegexFile) -> Result<UserAgentParser, Error>[src]

Trait Implementations

impl Debug for UserAgentParser[src]

impl Parser for UserAgentParser[src]

fn parse(&self, user_agent: &str) -> Client[src]

Returns the full Client info when given a user agent string

fn parse_device(&self, user_agent: &str) -> Device[src]

Returns just the Device info when given a user agent string

fn parse_os(&self, user_agent: &str) -> OS[src]

Returns just the OS info when given a user agent string

fn parse_user_agent(&self, user_agent: &str) -> UserAgent[src]

Returns just the UserAgent info when given a user agent string

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.