pub struct RobotsParser { /* private fields */ }
Implementations§
Source§impl RobotsParser
impl RobotsParser
Sourcepub fn new(rules: Vec<Robots>) -> RobotsParser
pub fn new(rules: Vec<Robots>) -> RobotsParser
Creates a new RobotsParser
from the given Robots
Rules
Sourcepub fn parse<'a>(input: &'a str) -> Result<RobotsParser, &'static str>
pub fn parse<'a>(input: &'a str) -> Result<RobotsParser, &'static str>
Parses a robots.txt input string
Sourcepub fn parse_path<P: AsRef<Path>>(path: P) -> Result<RobotsParser, &'static str>
pub fn parse_path<P: AsRef<Path>>(path: P) -> Result<RobotsParser, &'static str>
Parses a robots.txt file from the given path
Trait Implementations§
Source§impl Clone for RobotsParser
impl Clone for RobotsParser
Source§fn clone(&self) -> RobotsParser
fn clone(&self) -> RobotsParser
Returns a copy 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 moreSource§impl Debug for RobotsParser
impl Debug for RobotsParser
Source§impl PartialEq for RobotsParser
impl PartialEq for RobotsParser
impl Eq for RobotsParser
impl StructuralPartialEq for RobotsParser
Auto Trait Implementations§
impl Freeze for RobotsParser
impl RefUnwindSafe for RobotsParser
impl Send for RobotsParser
impl Sync for RobotsParser
impl Unpin for RobotsParser
impl UnwindSafe for RobotsParser
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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