[−][src]Struct uaparser::UserAgentParser
Handles the actual parsing of a user agent string by delegating to
the respective SubParser
Methods
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 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
impl Debug for UserAgentParser
[src]
Auto Trait Implementations
impl Send for UserAgentParser
impl Sync for UserAgentParser
impl Unpin for UserAgentParser
impl UnwindSafe for UserAgentParser
impl !RefUnwindSafe for UserAgentParser
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,