pub struct Builder<S = ()> { /* private fields */ }Available on crate feature
rpc only.Expand description
A Router being assembled.
S is the state the next handlers get, () until with_state is called.
Implementations§
Source§impl<S> Builder<S>
impl<S> Builder<S>
Sourcepub fn with_state<S2>(self, state: S2) -> Builder<S2>
pub fn with_state<S2>(self, state: S2) -> Builder<S2>
Gives the next handlers state.
Sourcepub fn handle_with<S2, H, Args, P>(self, state: S2, handler: H) -> Self
pub fn handle_with<S2, H, Args, P>(self, state: S2, handler: H) -> Self
Replies to P with handler, which gets its own state.
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for Builder<S>where
S: Freeze,
impl<S = ()> !RefUnwindSafe for Builder<S>
impl<S> Send for Builder<S>where
S: Send,
impl<S> Sync for Builder<S>where
S: Sync,
impl<S> Unpin for Builder<S>where
S: Unpin,
impl<S> UnsafeUnpin for Builder<S>where
S: UnsafeUnpin,
impl<S = ()> !UnwindSafe for Builder<S>
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