pub struct Router<State> { /* private fields */ }Expand description
Router mapping operations to handlers.
Implementations§
Source§impl<State> Router<State>
impl<State> Router<State>
pub fn from_state(state: State) -> Self
pub fn route<H, Args>(self, op: Op, handler: H) -> Selfwhere
H: IntoHandler<State, Args>,
pub fn fallback<H, Args>(self, handler: H) -> Selfwhere
H: IntoHandler<State, Args>,
pub fn state(&self) -> Arc<State>
pub async fn call(&self, ctx: RequestContext) -> Response
Trait Implementations§
Auto Trait Implementations§
impl<State> Freeze for Router<State>
impl<State> !RefUnwindSafe for Router<State>
impl<State> Send for Router<State>
impl<State> Sync for Router<State>
impl<State> Unpin for Router<State>
impl<State> !UnwindSafe for Router<State>
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