Enum dialectic::SessionIncomplete[][src]

pub enum SessionIncomplete<Tx, Rx> {
    BothHalves {
        tx: IncompleteHalf<Tx>,
        rx: IncompleteHalf<Rx>,
    },
    TxHalf {
        tx: IncompleteHalf<Tx>,
        rx: Rx,
    },
    RxHalf {
        tx: Tx,
        rx: IncompleteHalf<Rx>,
    },
}

The error returned when a closure which is expected to complete a channel’s session fails to finish the session of the channel it is given.

This error can arise either if the channel is dropped before its session is completed, or if it is stored somewhere and is dropped after the closure’s future is finished. The best way to ensure this error does not occur is to call close on the channel, which statically ensures it is dropped exactly when the session is complete.

Variants

BothHalves

Both the sending half Tx and the receiving half Rx did not complete the session correctly.

Fields of BothHalves

tx: IncompleteHalf<Tx>

The incomplete sending half: Unfinished if dropped before the end of the session, Unclosed if not dropped after the end of the session.

rx: IncompleteHalf<Rx>

The incomplete receiving half: Unfinished if dropped before the end of the session, Unclosed if not dropped after the end of the session.

TxHalf

Only the sending half Tx did not complete the session correctly, but the receiving half Rx did complete it correctly.

Fields of TxHalf

tx: IncompleteHalf<Tx>

The incomplete sending half: Unfinished if dropped before the end of the session, Unclosed if not dropped after the end of the session.

rx: Rx

The receiving half, whose session was completed.

RxHalf

Only the receiving half Rx did not complete the session correctly, but the sending half Tx did complete it correctly.

Fields of RxHalf

tx: Tx

The sending half, whose session was completed.

rx: IncompleteHalf<Rx>

The incomplete receiving half: Unfinished if dropped before the end of the session, Unclosed if not dropped after the end of the session.

Implementations

impl<Tx, Rx> SessionIncomplete<Tx, Rx>[src]

pub fn into_halves(
    self
) -> (Result<Tx, IncompleteHalf<Tx>>, Result<Rx, IncompleteHalf<Rx>>)
[src]

Extract the send and receive halves Tx and Rx, if they are present, from this SessionIncomplete error.

Trait Implementations

impl<Tx, Rx> Debug for SessionIncomplete<Tx, Rx>[src]

impl<Tx, Rx> Display for SessionIncomplete<Tx, Rx>[src]

impl<Tx, Rx> Error for SessionIncomplete<Tx, Rx>[src]

Auto Trait Implementations

impl<Tx, Rx> RefUnwindSafe for SessionIncomplete<Tx, Rx> where
    Rx: RefUnwindSafe,
    Tx: RefUnwindSafe

impl<Tx, Rx> Send for SessionIncomplete<Tx, Rx> where
    Rx: Send,
    Tx: Send

impl<Tx, Rx> Sync for SessionIncomplete<Tx, Rx> where
    Rx: Sync,
    Tx: Sync

impl<Tx, Rx> Unpin for SessionIncomplete<Tx, Rx> where
    Rx: Unpin,
    Tx: Unpin

impl<Tx, Rx> UnwindSafe for SessionIncomplete<Tx, Rx> where
    Rx: UnwindSafe,
    Tx: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<'a, T, S> As<'a, Val, T> for S where
    S: Into<T>, 
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<'a, T> By<'a, Mut> for T where
    T: 'a, 
[src]

type Type = &'a mut T

The type of Self when called by Convention.

impl<'a, T> By<'a, Ref> for T where
    T: 'a, 
[src]

type Type = &'a T

The type of Self when called by Convention.

impl<'a, T> By<'a, Val> for T[src]

type Type = T

The type of Self when called by Convention.

impl<'a, T> Convert<'a, Mut, Mut> for T where
    T: 'a, 
[src]

impl<'a, T> Convert<'a, Mut, Ref> for T where
    T: 'a, 
[src]

impl<'a, T> Convert<'a, Ref, Ref> for T where
    T: 'a, 
[src]

impl<'a, T> Convert<'a, Val, Val> for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.