pub trait Transmit {
    type Item;
    type Error;

    // Required method
    fn transmit<'life0, 'async_trait>(
        &'life0 mut self,
        item: Self::Item
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
       where Self::Item: 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

The Transmit trait allows for transmitting item to a peer.

Implementors of the Transmit trait are called ‘transmitters’.

Transmitters are defined by one required method, [transmit()]. The method will attempt to transmit some data to a peer asynchronously, returning if the transmission has succeeded.

Required Associated Types§

Required Methods§

source

fn transmit<'life0, 'async_trait>( &'life0 mut self, item: Self::Item ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where Self::Item: 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Attempts to transmit a value to the peer asynchronously.

Implementations on Foreign Types§

source§

impl<I> Transmit for Sender<I>where I: Send,

§

type Item = I

§

type Error = SendError<I>

source§

fn transmit<'life0, 'async_trait>( &'life0 mut self, item: Self::Item ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source§

impl<I> Transmit for Sender<I>where I: Send,

§

type Item = I

§

type Error = SendError<I>

source§

fn transmit<'life0, 'async_trait>( &'life0 mut self, item: Self::Item ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source§

impl<I> Transmit for UnboundedSender<I>where I: Send,

§

type Item = I

§

type Error = SendError<I>

source§

fn transmit<'life0, 'async_trait>( &'life0 mut self, item: Self::Item ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

source§

impl<T> Transmit for &mut Twhere T: Transmit + Send + ?Sized, T::Item: Send,

§

type Item = <T as Transmit>::Item

§

type Error = <T as Transmit>::Error

source§

fn transmit<'life0, 'async_trait>( &'life0 mut self, item: Self::Item ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where Self::Item: 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Implementors§

source§

impl<S, I> Transmit for FromSink<S, I>where I: Send, S: Sink<I> + Unpin + Send, S::Error: Send,

§

type Item = I

§

type Error = <S as Sink<I>>::Error

source§

impl<T, F, E> Transmit for TransmitMapErr<T, F>where T: Transmit + Send, T::Item: Send, F: FnOnce(T::Error) -> E + Send,

§

type Item = <T as Transmit>::Item

§

type Error = E

source§

impl<T, F, I, U, E> Transmit for With<T, F, I, U, E>where T: Transmit<Item = I, Error = E> + Send, F: FnMut(U) -> I + Send, I: Send, U: Send, E: Send,

§

type Item = U

§

type Error = E