logo
pub struct Matcher {
    pub regex: Regex,
    pub matches_query: bool,
}
Expand description

The matcher holds the url regex object.

Fields

regex: Regexmatches_query: bool

Implementations

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

Rule strings basically are just normal URL paths with placeholders in the format <name:converter> where the converter are optional. Currently we support following converters:

  • string(default)
  • int
  • float
  • path

If no converter is defined the default converter is used which means string.

URL rules that end with a slash are branch URLs, others are leaves. All branch URLs that are matched without a trailing slash will trigger a redirect to the same URL with the missing slash appended. We have a url without a trailing slash for branch url rule. So we redirect to the same url but with a trailing slash.

Converts to this type from the input type.

Converts to this type from the input type.

Same rule as &str.

Converts to this type from the input type.

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.