pub struct RobotsMatcher<'a> { /* private fields */ }Expand description
Precompiled matcher for repeated access checks against one RobotsTxt.
Build this with RobotsTxt::matcher when checking many paths against the
same parsed file. Construction allocates an index and precomputes rule
metadata, so RobotsTxt::is_allowed remains the lower-overhead option for
one-off checks.
Implementations§
Source§impl<'a> RobotsMatcher<'a>
impl<'a> RobotsMatcher<'a>
Sourcepub fn is_allowed(&self, user_agent: &str, path: &str) -> bool
pub fn is_allowed(&self, user_agent: &str, path: &str) -> bool
Returns whether user_agent may crawl path using the prebuilt index.
This has the same access semantics as RobotsTxt::is_allowed, including
exact user-agent precedence over *, merged exact groups, longest-match
rule selection, Allow tie wins, and implicit allowance for /robots.txt.
Trait Implementations§
Source§impl<'a> Clone for RobotsMatcher<'a>
impl<'a> Clone for RobotsMatcher<'a>
Source§fn clone(&self) -> RobotsMatcher<'a>
fn clone(&self) -> RobotsMatcher<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for RobotsMatcher<'a>
impl<'a> RefUnwindSafe for RobotsMatcher<'a>
impl<'a> Send for RobotsMatcher<'a>
impl<'a> Sync for RobotsMatcher<'a>
impl<'a> Unpin for RobotsMatcher<'a>
impl<'a> UnsafeUnpin for RobotsMatcher<'a>
impl<'a> UnwindSafe for RobotsMatcher<'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