pub enum Dispatch<T> {
Completed(T),
Aborted {
discarded: T,
reason: AbortReason,
},
}Expand description
What a handler produced, and what happened to it.
Not Copy: AbortReason carries the peer’s own words for why it withdrew
a request, and duplicating them would mean two copies of a string nobody
asked for.
Variants§
Completed(T)
The handler returned, and the request is no longer in flight.
Aborted
The handler returned, but the request had already been aborted.
The value is discarded because a response to an aborted request is not a response the specification defines: the peer has withdrawn the work, and answering anyway is how a bridge ends up delivering a result to a peer that has moved on.
Fields
§
discarded: TWhat the handler produced before it noticed.
§
reason: AbortReasonWhy it was stopped.
Implementations§
Source§impl<T> Dispatch<T>
impl<T> Dispatch<T>
Sourcepub fn into_inner(self) -> T
pub fn into_inner(self) -> T
The handler’s value, whether or not it will be sent.
Sourcepub const fn is_completed(&self) -> bool
pub const fn is_completed(&self) -> bool
Whether the result will be written to the peer.
Trait Implementations§
impl<T: Eq> Eq for Dispatch<T>
impl<T: PartialEq> StructuralPartialEq for Dispatch<T>
Auto Trait Implementations§
impl<T> Freeze for Dispatch<T>where
T: Freeze,
impl<T> RefUnwindSafe for Dispatch<T>where
T: RefUnwindSafe,
impl<T> Send for Dispatch<T>where
T: Send,
impl<T> Sync for Dispatch<T>where
T: Sync,
impl<T> Unpin for Dispatch<T>where
T: Unpin,
impl<T> UnsafeUnpin for Dispatch<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Dispatch<T>where
T: 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