pub enum DispatchResult<B, R> {
    Handled(R),
    Unhandled(B),
}Expand description
Result of invoking the method handler.
Variants§
Implementations§
Source§impl<B, R> DispatchResult<B, R>
 
impl<B, R> DispatchResult<B, R>
Sourcepub fn ok_or<E>(self, err: E) -> Result<R, E>
 
pub fn ok_or<E>(self, err: E) -> Result<R, E>
Transforms DispatchResult<B, R> into Result<R, E>, mapping Handled(r) to Ok(r) and
Unhandled(_) to Err(err).
Sourcepub fn ok_or_else<E, F: FnOnce() -> E>(self, errf: F) -> Result<R, E>
 
pub fn ok_or_else<E, F: FnOnce() -> E>(self, errf: F) -> Result<R, E>
Transforms DispatchResult<B, R> into Result<R, E>, mapping Handled(r) to Ok(r) and
Unhandled(_) to Err(err) using the provided function.
Auto Trait Implementations§
impl<B, R> Freeze for DispatchResult<B, R>
impl<B, R> RefUnwindSafe for DispatchResult<B, R>where
    R: RefUnwindSafe,
    B: RefUnwindSafe,
impl<B, R> Send for DispatchResult<B, R>
impl<B, R> Sync for DispatchResult<B, R>
impl<B, R> Unpin for DispatchResult<B, R>
impl<B, R> UnwindSafe for DispatchResult<B, R>where
    R: UnwindSafe,
    B: UnwindSafe,
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
    T: 'a,
 
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
    T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
    T: 'a,
 
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
    T: 'a,
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