Enum SessionIncomplete

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

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

§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

§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

§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§

Source§

impl<Tx, Rx> SessionIncomplete<Tx, Rx>

Source

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

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

Trait Implementations§

Source§

impl<Tx, Rx> Debug for SessionIncomplete<Tx, Rx>

Source§

fn fmt(&self, __f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Tx, Rx> Display for SessionIncomplete<Tx, Rx>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Tx, Rx> Error for SessionIncomplete<Tx, Rx>

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more

Auto Trait Implementations§

§

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

§

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

§

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§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn as_convention(this: S) -> T

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

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

Source§

type Type = &'a mut T

The type of Self when called by Convention.
Source§

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

Source§

type Type = &'a T

The type of Self when called by Convention.
Source§

impl<'a, T> By<'a, Val> for T

Source§

type Type = T

The type of Self when called by Convention.
Source§

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

Source§

fn convert(from: &mut T) -> &mut T

Convert from one calling convention to another. Read more
Source§

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

Source§

fn convert(from: &mut T) -> &T

Convert from one calling convention to another. Read more
Source§

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

Source§

fn convert(from: &T) -> &T

Convert from one calling convention to another. Read more
Source§

impl<'a, T> Convert<'a, Val, Val> for T

Source§

fn convert(from: T) -> T

Convert from one calling convention to another. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.