Struct cylon::Cylon[][src]

pub struct Cylon { /* fields omitted */ }

A Cylon is a DFA that recognizes rules from a compiled robots.txt file. By providing it a URL path, it can decide whether or not the robots file that compiled it allows or disallows that path in roughly O(n) time, where n is the length of the path.

Implementations

impl Cylon[src]

pub fn allow(&self, path: &str) -> bool[src]

Match whether the rules allow or disallow the target path.

pub fn compile(rules: Vec<Rule<'_>>) -> Self[src]

Compile a machine from a list of rules.

Trait Implementations

impl Debug for Cylon[src]

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

impl Serialize for Cylon[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.