pub fn case<const N: usize>(
        mut self,
    ) -> Result<
        Chan<<Choices::AsList as Select<<Number<N> as ToUnary>::AsUnary>>::Selected, Tx, Rx>,
        Branches<<<Choices::AsList as Select<<Number<N> as ToUnary>::AsUnary>>::Remainder as List>::AsTuple, Tx, Rx>,
    >
    where
        Number<N>: ToUnary,
        Choices::AsList: Select<<Number<N> as ToUnary>::AsUnary>,
        <Choices::AsList as Select<<Number<N> as ToUnary>::AsUnary>>::Selected: Session,
        <Choices::AsList as Select<<Number<N> as ToUnary>::AsUnary>>::Remainder: EachScoped + EachHasDual + HasLength + List,
    {
        let variant = self.variant;
        let tx = self.tx.take();
        let rx = self.rx.take();
        let drop_tx = self.drop_tx.clone();
        let drop_rx = self.drop_rx.clone();
        let branch: u8 = N
            .try_into()
            .expect("branch discriminant exceeded u8::MAX in `case`");
        if variant == branch {
            Ok(Chan {
                tx,
                rx,
                drop_tx,
                drop_rx,
                session: PhantomData,
            })
        } else {
            Err(Branches {
                // Subtract 1 from variant if we've eliminated a branch with a lower discriminant
                variant: if variant > branch {
                    variant - 1
                } else {
                    variant
                },
                tx,
                rx,
                drop_tx,
                drop_rx,
                protocols: PhantomData,
            })
        }
    }
/// Check if the selected protocol in this [`Branches`] was the `N`th protocol in its type. If
/// so, return the corresponding channel; otherwise, return all the other possibilities.
Check if the selected protocol in this [`Branches`] was the `N`th protocol in its type. If
so, return the corresponding channel; otherwise, return all the other possibilities.
Check if the selected protocol in this [ ` Branches ` ] was the ` N ` th protocol in its type . If so return the corresponding channel ; otherwise return all the other possibilities .
pub fn case<const N: usize>(
        mut self,
    ) -> Result<
        Chan<<Choices::AsList as Select<<Number<N> as ToUnary>::AsUnary>>::Selected, Tx, Rx>,
        Branches<<<Choices::AsList as Select<<Number<N> as ToUnary>::AsUnary>>::Remainder as List>::AsTuple, Tx, Rx>,
    >
    where
        Number<N>: ToUnary,
        Choices::AsList: Select<<Number<N> as ToUnary>::AsUnary>,
        <Choices::AsList as Select<<Number<N> as ToUnary>::AsUnary>>::Selected: Session,
        <Choices::AsList as Select<<Number<N> as ToUnary>::AsUnary>>::Remainder: EachScoped + EachHasDual + HasLength + List,
    {
        let variant = self.variant;
        let tx = self.tx.take();
        let rx = self.rx.take();
        let drop_tx = self.drop_tx.clone();
        let drop_rx = self.drop_rx.clone();
        let branch: u8 = N
            .try_into()
            .expect("branch discriminant exceeded u8::MAX in `case`");
        if variant == branch {
            Ok(Chan {
                tx,
                rx,
                drop_tx,
                drop_rx,
                session: PhantomData,
            })
        } else {
            Err(Branches {
                // Subtract 1 from variant if we've eliminated a branch with a lower discriminant
                variant: if variant > branch {
                    variant - 1
                } else {
                    variant
                },
                tx,
                rx,
                drop_tx,
                drop_rx,
                protocols: PhantomData,
            })
        }
    }
pub fn case < const N : usize > ( mut self , ) -> Result < Chan < < Choices :: AsList as Select < < Number < N > as ToUnary > :: AsUnary > > :: Selected , Tx , Rx > , Branches < < < Choices :: AsList as Select < < Number < N > as ToUnary > :: AsUnary > > :: Remainder as List > :: AsTuple , Tx , Rx > , > where Number < N > : ToUnary , Choices :: AsList : Select < < Number < N > as ToUnary > :: AsUnary > , < Choices :: AsList as Select < < Number < N > as ToUnary > :: AsUnary > > :: Selected : Session , < Choices :: AsList as Select < < Number < N > as ToUnary > :: AsUnary > > :: Remainder : EachScoped + EachHasDual + HasLength + List , { let variant = self . variant ; let tx = self . tx . take ( ) ; let rx = self . rx . take ( ) ; let drop_tx = self . drop_tx . clone ( ) ; let drop_rx = self . drop_rx . clone ( ) ; let branch : u8 = N . try_into ( ) . expect ( " " ) ; if variant == branch { Ok ( Chan { tx , rx , drop_tx , drop_rx , session : PhantomData , } ) } else { Err ( Branches { // Subtract 1 from variant if we've eliminated a branch with a lower discriminant variant : if variant > branch { variant - 1 } else { variant } , tx , rx , drop_tx , drop_rx , protocols : PhantomData , } ) } }
Check if the selected protocol in this [`Branches`] was the `N`th protocol in its type.
Check if the selected protocol in this [ ` Branches ` ] was the ` N ` th protocol in its type .
mut self