pub struct FetchedRobotsTxt { /* private fields */ }
Expand description
A model of the robots.txt file that was downloaded over the network.
This model takes into account HTTP response codes when loading the robots.txt file.
To work with this model you should use the trait robotparser::service::RobotsTxtService
.
To create this structure you should use the robotparser::parser::parse_fetched_robots_txt
.
Implementations§
Source§impl FetchedRobotsTxt
impl FetchedRobotsTxt
Sourcepub fn get_fetched_at(&self) -> &SystemTime
pub fn get_fetched_at(&self) -> &SystemTime
Returns the system time when the robots.txt file was downloaded over the network.
Trait Implementations§
Source§impl Clone for FetchedRobotsTxt
impl Clone for FetchedRobotsTxt
Source§fn clone(&self) -> FetchedRobotsTxt
fn clone(&self) -> FetchedRobotsTxt
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 moreSource§impl Debug for FetchedRobotsTxt
impl Debug for FetchedRobotsTxt
Source§impl RobotsTxtService for FetchedRobotsTxt
impl RobotsTxtService for FetchedRobotsTxt
Source§fn can_fetch(&self, user_agent: &str, url: &Url) -> bool
fn can_fetch(&self, user_agent: &str, url: &Url) -> bool
Using the parsed robots.txt decide if useragent can fetch url.
Source§fn get_crawl_delay(&self, user_agent: &str) -> Option<Duration>
fn get_crawl_delay(&self, user_agent: &str) -> Option<Duration>
Returns the crawl delay for this user agent as a Duration, or None if no crawl delay is defined.
Source§fn normalize_url(&self, url: &mut Url) -> bool
fn normalize_url(&self, url: &mut Url) -> bool
Removes the request parameters from the url that were listed in the
Clean-param
directive.
This method CHECKS that the origin of the transmitted url matches the origin of robots.txt.
Returns true if the operation was applied to the passed url.
In other cases it returns false.Source§fn normalize_url_ignore_origin(&self, url: &mut Url)
fn normalize_url_ignore_origin(&self, url: &mut Url)
Removes the request parameters from the url that were listed in the
Clean-param
directive.
This method DOES NOT CHECK that the origin of the transmitted url coincides with the origin of robots.txt.Source§fn get_sitemaps(&self) -> &[Url]
fn get_sitemaps(&self) -> &[Url]
Returns the list of URL sitemaps that have been listed in the robots.txt file.
Source§fn get_req_rate(&self, user_agent: &str) -> Option<RequestRate>
fn get_req_rate(&self, user_agent: &str) -> Option<RequestRate>
Returns information about the restrictions set for sending HTTP requests to the server.
Auto Trait Implementations§
impl Freeze for FetchedRobotsTxt
impl RefUnwindSafe for FetchedRobotsTxt
impl Send for FetchedRobotsTxt
impl Sync for FetchedRobotsTxt
impl Unpin for FetchedRobotsTxt
impl UnwindSafe for FetchedRobotsTxt
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