pub struct RobotsFetcher { /* private fields */ }Expand description
Robots.txt fetcher with RFC 9309 compliance
Implementations§
Source§impl RobotsFetcher
impl RobotsFetcher
Sourcepub fn new(config: RobotsConfig) -> Self
pub fn new(config: RobotsConfig) -> Self
Create a new fetcher
Sourcepub fn stats(&self) -> Arc<FetchStats>
pub fn stats(&self) -> Arc<FetchStats>
Get fetch statistics
Sourcepub async fn fetch(&self, url: &Url) -> RobotsPolicy
pub async fn fetch(&self, url: &Url) -> RobotsPolicy
Fetch and parse robots.txt for a URL
Sourcepub async fn fetch_for_key(&self, key: &RobotsCacheKey) -> RobotsPolicy
pub async fn fetch_for_key(&self, key: &RobotsCacheKey) -> RobotsPolicy
Fetch robots.txt for a cache key
Sourcepub async fn fetch_for_key_conditional(
&self,
key: &RobotsCacheKey,
etag: Option<&str>,
last_modified: Option<&str>,
) -> RobotsPolicy
pub async fn fetch_for_key_conditional( &self, key: &RobotsCacheKey, etag: Option<&str>, last_modified: Option<&str>, ) -> RobotsPolicy
Fetch robots.txt with conditional GET support
If etag or last_modified is provided, the request will include
the appropriate conditional headers. Returns the previous policy unchanged
if 304 Not Modified is received.
Auto Trait Implementations§
impl Freeze for RobotsFetcher
impl !RefUnwindSafe for RobotsFetcher
impl Send for RobotsFetcher
impl Sync for RobotsFetcher
impl Unpin for RobotsFetcher
impl !UnwindSafe for RobotsFetcher
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