pub struct Router<H> { /* private fields */ }
Implementations§
Source§impl<H> Router<H>where
H: Clone,
impl<H> Router<H>where
H: Clone,
pub fn new() -> Self
pub fn middleware(&mut self, handler: H) -> &mut Self
pub fn scope( &mut self, path: &str, builder: impl FnOnce(&mut Router<H>), ) -> &mut Self
pub fn handle(&mut self, method: Method, path: &str, handler: H) -> &mut Self
pub fn get(&mut self, path: &str, handler: H) -> &mut Self
pub fn post(&mut self, path: &str, handler: H) -> &mut Self
pub fn delete(&mut self, path: &str, handler: H) -> &mut Self
pub fn patch(&mut self, path: &str, handler: H) -> &mut Self
pub fn put(&mut self, path: &str, handler: H) -> &mut Self
pub fn options(&mut self, path: &str, handler: H) -> &mut Self
pub fn head(&mut self, path: &str, handler: H) -> &mut Self
pub fn connect(&mut self, path: &str, handler: H) -> &mut Self
pub fn trace(&mut self, path: &str, handler: H) -> &mut Self
pub fn any(&mut self, path: &str, handler: H) -> &mut Self
pub fn resource( &mut self, path: &str, resource: Vec<((&str, &str, &Method), H)>, ) -> &mut Self
pub fn resources( &mut self, path: &str, resources: Vec<((&str, &str, &Method), H)>, ) -> &mut Self
pub fn find<'a>( &'a self, method: &'a Method, path: &'a str, ) -> Option<(&'a H, Vec<(&'a str, &'a str)>)>
Trait Implementations§
Auto Trait Implementations§
impl<H> Freeze for Router<H>
impl<H> RefUnwindSafe for Router<H>where
H: RefUnwindSafe,
impl<H> Send for Router<H>where
H: Send,
impl<H> Sync for Router<H>where
H: Sync,
impl<H> Unpin for Router<H>where
H: Unpin,
impl<H> UnwindSafe for Router<H>where
H: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more