pub struct RobotsChecker { /* private fields */ }Expand description
Robots.txt checker
Implementations§
Source§impl RobotsChecker
impl RobotsChecker
Sourcepub fn set_enabled(&mut self, enabled: bool)
pub fn set_enabled(&mut self, enabled: bool)
Enable/disable robots.txt respect
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Is robots.txt respected?
Sourcepub fn robots_url(url: &Url) -> Option<Url>
pub fn robots_url(url: &Url) -> Option<Url>
URL of the robots.txt for a site
Sourcepub fn cache_robots(&self, url: &Url, content: &str)
pub fn cache_robots(&self, url: &Url, content: &str)
Caches a robots.txt
Sourcepub fn is_allowed(&self, url: &Url, robots_content: Option<&str>) -> bool
pub fn is_allowed(&self, url: &Url, robots_content: Option<&str>) -> bool
Checks if a URL is allowed
Sourcepub fn get_crawl_delay(&self, url: &Url) -> Option<Duration>
pub fn get_crawl_delay(&self, url: &Url) -> Option<Duration>
Retrieves the crawl-delay
Sourcepub fn cache(&self) -> &RobotsCache
pub fn cache(&self) -> &RobotsCache
Access to the cache
Auto Trait Implementations§
impl !Freeze for RobotsChecker
impl RefUnwindSafe for RobotsChecker
impl Send for RobotsChecker
impl Sync for RobotsChecker
impl Unpin for RobotsChecker
impl UnwindSafe for RobotsChecker
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