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

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

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

In order to support the Chan::choose method, all backends must implement Transmit<Choice<N>, Val> for all N. For more information, see Choice.

Examples

For an example of implementing Transmit, check out the source for the implementation of Transmit for mpsc::Sender.

Associated Types

type Error[src]

The type of possible errors when sending.

Loading content...

Required methods

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

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

Loading content...

Implementors

impl<'b, T: Send + Any> Transmit<T, Val> for dialectic::backend::mpsc::Sender<'b>[src]

This is supported on crate feature mpsc only.

type Error = SendError<T>

impl<'b, T: Send + Any> Transmit<T, Val> for UnboundedSender<'b>[src]

This is supported on crate feature mpsc only.

type Error = SendError<T>

impl<N: Unary + Send + 'static, F, E, W> Transmit<Choice<N>, Val> for dialectic::backend::serde::Sender<F, E, W> where
    F: Serializer + Unpin + Send,
    F::Output: Send,
    F::Error: Send,
    E: Encoder<F::Output> + Send,
    W: AsyncWrite + Unpin + Send
[src]

This is supported on crate feature serde only.

type Error = SendError<F, E>

impl<T, Convention: CallingConvention, C> Transmit<T, Convention> for Available<C> where
    C: Transmit<T, Convention>, 
[src]

type Error = C::Error

impl<T, F, E, W> Transmit<T, Ref> for dialectic::backend::serde::Sender<F, E, W> where
    T: Serialize + Sync,
    F: Serializer + Unpin + Send,
    F::Output: Send,
    F::Error: Send,
    E: Encoder<F::Output> + Send,
    W: AsyncWrite + Unpin + Send
[src]

This is supported on crate feature serde only.

type Error = SendError<F, E>

Loading content...