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>
impl<Tx, Rx> SessionIncomplete<Tx, Rx>
Sourcepub fn into_halves(
self,
) -> (Result<Tx, IncompleteHalf<Tx>>, Result<Rx, IncompleteHalf<Rx>>)
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.