Trait dialectic::backend::Transmit[][src]

pub trait Transmit<T, C: Convention = Val>: Transmitter {
    fn send<'a, 'async_lifetime>(
        &'async_lifetime mut self,
        message: <T as By<'a, C>>::Type
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_lifetime>>
    where
        T: By<'a, C>,
        'a: 'async_lifetime
; }

If a transport is Transmit<T, C>, we can use it to send a message of type T by Val, Ref, or Mut, depending on the calling convention specified by C.

If you’re writing a function and need a lot of different Transmit<T, C> bounds, the Transmitter attribute macro can help you specify them more succinctly.

Examples

For an example of implementing Transmit, check out the source for the implementation of Transmit for the dialectic_tokio_mpsc::Sender type in the dialectic_tokio_mpsc crate.

Required methods

fn send<'a, 'async_lifetime>(
    &'async_lifetime mut self,
    message: <T as By<'a, C>>::Type
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_lifetime>> where
    T: By<'a, C>,
    'a: 'async_lifetime, 
[src]

Send a message using the Convention specified by the trait implementation.

Loading content...

Implementors

Loading content...