Struct cylon::Compiler[][src]

pub struct Compiler { /* fields omitted */ }

A compiler takes an input robots.txt file and outputs a compiled Cylon, which can be used to efficiently match a large number of paths against the robots.txt file.

Implementations

impl Compiler[src]

pub fn new(user_agent: &str) -> Self[src]

Build a new compiler that parses rules for the given user agent from a robots.txt file.

pub async fn compile<R: AsyncRead + Unpin>(&self, file: R) -> Result<Cylon>[src]

Parse an input robots.txt file into a Cylon that can recognize whether or not a path matches the rules for the Parser's user agent.

Trait Implementations

impl Debug for Compiler[src]

impl<'de> Deserialize<'de> for Compiler[src]

impl Serialize for Compiler[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.