logo
pub struct Rule {
    pub matcher: Matcher,
    pub methods: HashSet<Method>,
    pub endpoint: String,
    pub provide_automatic_options: bool,
}
Expand description

A Rule represents one URL pattern.

Fields

matcher: Matcher

The matcher is used to match the url path.

methods: HashSet<Method>

A set of http methods this rule applies to.

endpoint: String

The endpoint for this rule.

provide_automatic_options: bool

Implementations

Create a new Rule. Matcher basically are used to hold url regular expressions. Rule endpoint is a string that is used for URL generation. Rule methods is an array of http methods this rule applies to, if GET is present in it and HEAD is not, HEAD is added automatically.

Check if the rule matches a given path.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

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

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Get the TypeId of this object.