pub struct ParsedRobotsKey { /* private fields */ }Expand description
A robots.txt has lines of key/value pairs. A ParsedRobotsKey represents a key.
This class can parse a text-representation (including common typos) and represent them as an enumeration which allows for faster processing afterwards. For unparsable keys, the original string representation is kept.
Implementations§
Source§impl ParsedRobotsKey
impl ParsedRobotsKey
Sourcepub fn parse(&mut self, key: &str)
pub fn parse(&mut self, key: &str)
Parse given key text. Does not copy the text, so the text_key must stay
valid for the object’s life-time or the next parse() call.
Sourcepub fn get_type(&self) -> &ParseKeyType
pub fn get_type(&self) -> &ParseKeyType
Returns the type of key.
Sourcepub fn get_unknown_text(&self) -> String
pub fn get_unknown_text(&self) -> String
If this is an unknown key, get the text.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ParsedRobotsKey
impl RefUnwindSafe for ParsedRobotsKey
impl Send for ParsedRobotsKey
impl Sync for ParsedRobotsKey
impl Unpin for ParsedRobotsKey
impl UnwindSafe for ParsedRobotsKey
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