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
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
Methods
impl Rule
[src]
pub fn new(matcher: Matcher, methods: &[Method], endpoint: &str) -> Rule
[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.
pub fn matched(&self, path: &str) -> Option<Result<ViewArgs, RequestSlashError>>
[src]
Check if the rule matches a given path.
Trait Implementations
impl Clone for Rule
[src]
fn clone(&self) -> Rule
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more