Skip to main content

Resource

Trait Resource 

Source
pub trait Resource<T>
where T: ResourcePath,
{ // Required methods fn path(&self) -> &str; fn resource_path(&mut self) -> &mut Path<T>; }
Expand description

A value that can be matched by a Router.

Path implements it, a request type can implement it to be matched directly.

Required Methods§

Source

fn path(&self) -> &str

Path to match.

Source

fn resource_path(&mut self) -> &mut Path<T>

Path state that stores match results.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<St> Resource<Url> for WebRequest<St>

Source§

impl<T> Resource<T> for Path<T>
where T: ResourcePath,