[−][src]Struct dialectic::Branches
The result of offer
, Branches<Tx, Rx, Ps>
represents an enumeration of the possible
new channel states that could result from the offering of the type-level list of protocols Ps
.
To find out which protocol was selected by the other party, use Branches::case
, or better
yet, use the offer!
macro to ensure you don't miss any cases.
Implementations
impl<'a, Tx, Rx, Choices, P, Ps, E> Branches<Tx, Rx, Choices, E> where
Choices: Tuple<AsList = (P, Ps)>,
(P, Ps): List<AsTuple = Choices>,
P: Actionable<E>,
Ps: EachActionable<E> + List,
E: Environment,
E::Dual: Environment,
P::Dual: Actionable<E::Dual>,
<P::Env as EachSession>::Dual: Environment,
<<P::Action as Actionable<P::Env>>::Env as EachSession>::Dual: Environment,
<<P::Dual as Actionable<E::Dual>>::Env as EachSession>::Dual: Environment,
[src]
Choices: Tuple<AsList = (P, Ps)>,
(P, Ps): List<AsTuple = Choices>,
P: Actionable<E>,
Ps: EachActionable<E> + List,
E: Environment,
E::Dual: Environment,
P::Dual: Actionable<E::Dual>,
<P::Env as EachSession>::Dual: Environment,
<<P::Action as Actionable<P::Env>>::Env as EachSession>::Dual: Environment,
<<P::Dual as Actionable<E::Dual>>::Env as EachSession>::Dual: Environment,
#[must_use =
"all possible choices must be handled (add cases to match the type of this `Offer<...>`)"]pub fn case(
self
) -> Result<Chan<Tx, Rx, <P as Actionable<E>>::Action, <P as Actionable<E>>::Env>, Branches<Tx, Rx, Ps::AsTuple, E>>
[src]
self
) -> Result<Chan<Tx, Rx, <P as Actionable<E>>::Action, <P as Actionable<E>>::Env>, Branches<Tx, Rx, Ps::AsTuple, E>>
Check if the selected protocol in this Branches
was P
. If so, return the corresponding
channel; otherwise, return all the other possibilities.
impl<'a, Tx, Rx, E: Environment> Branches<Tx, Rx, (), E> where
E::Dual: Environment,
[src]
E::Dual: Environment,
pub fn empty_case<T>(self) -> Result<T, OutOfRangeChoice>
[src]
Attempt to eliminate an empty Branches
, returning an error if the originating
discriminant for this set of protocol choices was out of range.
This function is only callable on empty Branches
, which under ordinary circumstances
means it proves the unreachability of its calling location. However, if the other end of the
channel breaks protocol, an empty Branches
can in fact be constructed, and this function
will then signal an error.
Trait Implementations
impl<Tx: Debug, Rx: Debug, Choices: Debug, E: Debug> Debug for Branches<Tx, Rx, Choices, E> where
Choices: Tuple,
Choices::AsList: EachActionable<E>,
E: Environment,
E::Dual: Environment,
[src]
Choices: Tuple,
Choices::AsList: EachActionable<E>,
E: Environment,
E::Dual: Environment,
Auto Trait Implementations
impl<Tx, Rx, Choices, E> RefUnwindSafe for Branches<Tx, Rx, Choices, E> where
Choices: RefUnwindSafe,
E: RefUnwindSafe,
Rx: RefUnwindSafe,
Tx: RefUnwindSafe,
[src]
Choices: RefUnwindSafe,
E: RefUnwindSafe,
Rx: RefUnwindSafe,
Tx: RefUnwindSafe,
impl<Tx, Rx, Choices, E> Send for Branches<Tx, Rx, Choices, E> where
Choices: Send,
E: Send,
Rx: Send,
Tx: Send,
[src]
Choices: Send,
E: Send,
Rx: Send,
Tx: Send,
impl<Tx, Rx, Choices, E> Sync for Branches<Tx, Rx, Choices, E> where
Choices: Sync,
E: Sync,
Rx: Sync,
Tx: Sync,
[src]
Choices: Sync,
E: Sync,
Rx: Sync,
Tx: Sync,
impl<Tx, Rx, Choices, E> Unpin for Branches<Tx, Rx, Choices, E> where
Choices: Unpin,
E: Unpin,
Rx: Unpin,
Tx: Unpin,
[src]
Choices: Unpin,
E: Unpin,
Rx: Unpin,
Tx: Unpin,
impl<Tx, Rx, Choices, E> UnwindSafe for Branches<Tx, Rx, Choices, E> where
Choices: UnwindSafe,
E: UnwindSafe,
Rx: UnwindSafe,
Tx: UnwindSafe,
[src]
Choices: UnwindSafe,
E: UnwindSafe,
Rx: UnwindSafe,
Tx: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<'a, T> CallBy<'a, Mut> for T where
T: 'a,
[src]
T: 'a,
impl<'a, T> CallBy<'a, Ref> for T where
T: 'a,
[src]
T: 'a,
impl<'a, T> CallBy<'a, Val> for T
[src]
type Type = T
The type of Self
when called by Convention
.
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,