Struct RobotsTxt

Source
pub struct RobotsTxt { /* private fields */ }
Expand description

The robots.txt model that was obtained after parsing the text of 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_robots_txt.

Trait Implementations§

Source§

impl Clone for RobotsTxt

Source§

fn clone(&self) -> RobotsTxt

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RobotsTxt

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl RobotsTxtService for RobotsTxt

Source§

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>

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

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)

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]

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>

Returns information about the restrictions set for sending HTTP requests to the server.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,