pub struct RobotsTxtParser<'a, Handler: RobotsParseHandler> { /* private fields */ }Expand description
A robotstxt parser.
Implementations§
Source§impl<'a, Handler: RobotsParseHandler> RobotsTxtParser<'a, Handler>
impl<'a, Handler: RobotsParseHandler> RobotsTxtParser<'a, Handler>
pub fn new(robots_body: &'a str, handler: &'a mut Handler) -> Self
Sourcepub fn parse(&mut self)
pub fn parse(&mut self)
Parse body of this Parser’s robots.txt and emit parse callbacks. This will accept typical typos found in robots.txt, such as ‘disalow’.
Note, this function will accept all kind of input but will skip everything that does not look like a robots directive.
Sourcepub fn parse_key_value(line: &str) -> (&str, &str, bool)
pub fn parse_key_value(line: &str) -> (&str, &str, bool)
Attempts to parse a line of robots.txt into a key/value pair.
On success, the parsed key and value, and true, are returned. If parsing is
unsuccessful, parse_key_value returns two empty strings and false.
pub fn need_escape_value_for_key(key: &ParsedRobotsKey) -> bool
Auto Trait Implementations§
impl<'a, Handler> Freeze for RobotsTxtParser<'a, Handler>
impl<'a, Handler> RefUnwindSafe for RobotsTxtParser<'a, Handler>where
Handler: RefUnwindSafe,
impl<'a, Handler> Send for RobotsTxtParser<'a, Handler>where
Handler: Send,
impl<'a, Handler> Sync for RobotsTxtParser<'a, Handler>where
Handler: Sync,
impl<'a, Handler> Unpin for RobotsTxtParser<'a, Handler>
impl<'a, Handler> !UnwindSafe for RobotsTxtParser<'a, Handler>
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