pub async fn recv<T, P>(mut self) -> Result<(T, Chan<P, Tx, Rx>), Rx::Error>
    where
        S: Session<Action = Recv<T, P>>,
        P: Session,
        Rx: Receive<T>,
    {
        let result = self.rx.as_mut().unwrap().recv().await?;
        Ok((result, self.unchecked_cast()))
    }
/// Receive something of type `T` on the channel, returning the pair of the received object and
/// the channel.
///
/// # Errors
///
/// This function returns the [`Receiver::Error`] for the underlying `Rx` connection if there
/// was an error while receiving.
///
/// # Examples
///
/// ```
/// use dialectic::prelude::*;
/// use dialectic_tokio_mpsc as mpsc;
///
/// # #[tokio::main]
/// # async fn main() -> Result<(), Box<dyn std::error::Error>> {
/// let (c1, c2) = <Session! { recv String }>::channel(|| mpsc::channel(1));
/// c2.send("Hello, world!".to_string()).await?;
///
/// let (s, c1) = c1.recv().await?;
/// assert_eq!(s, "Hello, world!");
/// # Ok(())
/// # }
/// ```
Receive something of type `T` on the channel, returning the pair of the received object and
the channel.
Receive something of type ` T ` on the channel returning the pair of the received object and the channel .
pub async fn recv<T, P>(mut self) -> Result<(T, Chan<P, Tx, Rx>), Rx::Error>
    where
        S: Session<Action = Recv<T, P>>,
        P: Session,
        Rx: Receive<T>,
    {
        let result = self.rx.as_mut().unwrap().recv().await?;
        Ok((result, self.unchecked_cast()))
    }
pub async fn recv < T , P > ( mut self ) -> Result < ( T , Chan < P , Tx , Rx > ) , Rx :: Error > where S : Session < Action = Recv < T , P > > , P : Session , Rx : Receive < T > , { let result = self . rx . as_mut ( ) . unwrap ( ) . recv ( ) . await ? ; Ok ( ( result , self . unchecked_cast ( ) ) ) }
Receive something of type `T` on the channel, returning the pair of the received object and
the channel.
Receive something of type ` T ` on the channel returning the pair of the received object and the channel .
mut self
errors
This function returns the [`Receiver::Error`] for the underlying `Rx` connection if there
was an error while receiving.
This function returns the [ ` Receiver :: Error ` ] for the underlying ` Rx ` connection if there was an error while receiving .
examples
```
use dialectic::prelude::*;
use dialectic_tokio_mpsc as mpsc.
` ` ` use dialectic :: prelude :: * ; use dialectic_tokio_mpsc as mpsc .
#[tokio::main]
None
async fn main() -> result<(), box<dyn std::error::error>> {
None
ok(())
None
}
None