pub trait Guard {
// Required method
fn check(&self, request: &RequestHead) -> bool;
// Provided method
fn fmt(&self, f: &mut Formatter<'_>) -> Result { ... }
}Expand description
Trait defines resource guards. Guards are used for route selection.
Guards can not modify the request object. But it is possible
to store extra attributes on a request by using the Extensions container.
Extensions containers are available via the RequestHead::extensions() method.
Required Methods§
Sourcefn check(&self, request: &RequestHead) -> bool
fn check(&self, request: &RequestHead) -> bool
Check if request matches predicate