Struct intrepid_core::Router
source · pub struct Router<State> { /* private fields */ }Expand description
A router for actions that can be invoked as services.
Implementations§
source§impl<State> Router<State>
impl<State> Router<State>
sourcepub fn capture<T>(&self, path: impl AsRef<str>) -> Result<T, PathError>where
T: DeserializeOwned,
pub fn capture<T>(&self, path: impl AsRef<str>) -> Result<T, PathError>where
T: DeserializeOwned,
Given a path, attempt to deserialize the path fragments into a given type.
sourcepub fn handle_frame_with_state(&self, frame: Frame, state: State) -> FrameFuture ⓘ
pub fn handle_frame_with_state(&self, frame: Frame, state: State) -> FrameFuture ⓘ
Call an action with a given state.
sourcepub fn insert<ActionHandler, Args>(
&mut self,
route: impl Into<String>,
given_action: ActionHandler,
) -> Result<()>
pub fn insert<ActionHandler, Args>( &mut self, route: impl Into<String>, given_action: ActionHandler, ) -> Result<()>
Insert a new action into the router, turning it into an [ActionEndpoint].
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)