pub async fn send_ref<T: ?Sized, P>(mut self, message: &T) -> Result<Chan<P, Tx, Rx>, Tx::Error>
    where
        S: Session<Action = Send<T::ReceivedAs, P>>,
        P: Session,
        Tx: Transmit<T, Ref>,
        T: Transmittable,
    {
        self.tx.as_mut().unwrap().send(message).await?;
        Ok(self.unchecked_cast())
    }
/// Send something of type `T` on the channel *by reference*, returning the channel.
///
/// # Errors
///
/// This function returns the [`Transmitter::Error`] for the underlying `Tx` connection if there
/// was an error while sending.
///
/// # 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! { send String }>::channel(|| mpsc::channel(1));
/// c1.send_ref(&"Hello, world!".to_string()).await?;
///
/// let (s, c2) = c2.recv().await?;
/// assert_eq!(s, "Hello, world!");
/// # Ok(())
/// # }
/// ```
Send something of type `T` on the channel *by reference*, returning the channel.
Send something of type ` T ` on the channel * by reference * returning the channel .
pub async fn send_ref<T: ?Sized, P>(mut self, message: &T) -> Result<Chan<P, Tx, Rx>, Tx::Error>
    where
        S: Session<Action = Send<T::ReceivedAs, P>>,
        P: Session,
        Tx: Transmit<T, Ref>,
        T: Transmittable,
    {
        self.tx.as_mut().unwrap().send(message).await?;
        Ok(self.unchecked_cast())
    }
pub async fn send_ref < T : ? Sized , P > ( mut self , message : & T ) -> Result < Chan < P , Tx , Rx > , Tx :: Error > where S : Session < Action = Send < T :: ReceivedAs , P > > , P : Session , Tx : Transmit < T , Ref > , T : Transmittable , { self . tx . as_mut ( ) . unwrap ( ) . send ( message ) . await ? ; Ok ( self . unchecked_cast ( ) ) }
Send something of type `T` on the channel *by reference*, returning the channel.
Send something of type ` T ` on the channel * by reference * returning the channel .
mut self
message
&T
errors
This function returns the [`Transmitter::Error`] for the underlying `Tx` connection if there
was an error while sending.
This function returns the [ ` Transmitter :: Error ` ] for the underlying ` Tx ` connection if there was an error while sending .
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