Trait Transmit

Source
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,

Source§

type Item = I

Source§

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,

Source§

type Item = I

Source§

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,

Source§

type Item = I

Source§

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 T
where T: Transmit + Send + ?Sized, T::Item: Send,

Source§

type Item = <T as Transmit>::Item

Source§

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,

Source§

type Item = I

Source§

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,

Source§

type Item = <T as Transmit>::Item

Source§

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,

Source§

type Item = U

Source§

type Error = E