Struct chilli::routing::Rule [] [src]

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

A Rule represents one URL pattern.

Fields

The matcher is used to match the url path.

A set of http methods this rule applies to.

The endpoint for this rule.

Methods

impl Rule
[src]

[src]

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.

[src]

Check if the rule matches a given path.

Trait Implementations

impl Clone for Rule
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Rule
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for Rule

impl Sync for Rule