pub struct Parser { /* private fields */ }Expand description
Referer parser backed by the snowplow referers.yml database.
Load the database once with Parser::new, then call Parser::lookup
for each referer URL.
Implementations§
Source§impl Parser
impl Parser
Sourcepub fn lookup<'p, 'u>(&'p self, url: &'u Url) -> Option<Entry<'p, 'u>>
pub fn lookup<'p, 'u>(&'p self, url: &'u Url) -> Option<Entry<'p, 'u>>
Look up a referer URL. Returns borrowed data — no allocation unless percent-decoding is needed for the search term.
Resolution order (most specific first):
- Walk subdomains trying domain+path (e.g. google.fr/imgres)
- Walk subdomains trying domain only (e.g. google.fr)
Auto Trait Implementations§
impl Freeze for Parser
impl RefUnwindSafe for Parser
impl Send for Parser
impl Sync for Parser
impl Unpin for Parser
impl UnwindSafe for Parser
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