pub struct Extractor<'a> { /* private fields */ }Expand description
User Agent extractor.
Implementations§
Source§impl<'a> Extractor<'a>
impl<'a> Extractor<'a>
Sourcepub fn extract(&'a self, ua: &'a str) -> Option<ValueRef<'a>>
pub fn extract(&'a self, ua: &'a str) -> Option<ValueRef<'a>>
Tries the loaded Parser, upon finding the first
matching Parser performs data extraction following its
replacement directives and returns the result.
Returns None if:
- no matching parser was found
- the match does not have any matching groups and
Parser::family_replacementis unset Parser::family_replacementhas a substitution but there is no group in the regex
Auto Trait Implementations§
impl<'a> Freeze for Extractor<'a>
impl<'a> RefUnwindSafe for Extractor<'a>
impl<'a> Send for Extractor<'a>
impl<'a> Sync for Extractor<'a>
impl<'a> Unpin for Extractor<'a>
impl<'a> UnwindSafe for Extractor<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more