[−][src]Trait dialectic::backend::Transmit
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
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]
&'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,
Send a message using the CallingConvention
specified by the trait implementation.
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>
pub fn send<'a, 'async_lifetime>(
&'async_lifetime mut self,
message: <T as CallBy<'a, Val>>::Type
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_lifetime>> where
'a: 'async_lifetime,
[src]
&'async_lifetime mut self,
message: <T as CallBy<'a, Val>>::Type
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_lifetime>> where
'a: 'async_lifetime,
impl<'b, T: Send + Any> Transmit<T, Val> for UnboundedSender<'b>
[src]
This is supported on crate feature
mpsc
only.type Error = SendError<T>
pub fn send<'a, 'async_lifetime>(
&'async_lifetime mut self,
message: <T as CallBy<'a, Val>>::Type
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_lifetime>> where
'a: 'async_lifetime,
[src]
&'async_lifetime mut self,
message: <T as CallBy<'a, Val>>::Type
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_lifetime>> where
'a: 'async_lifetime,
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]
F: Serializer + Unpin + Send,
F::Output: Send,
F::Error: Send,
E: Encoder<F::Output> + Send,
W: AsyncWrite + Unpin + Send,
This is supported on crate feature
serde
only.type Error = SendError<F, E>
pub fn send<'a, 'async_lifetime>(
&'async_lifetime mut self,
message: <Choice<N> as CallBy<'a, Val>>::Type
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_lifetime>> where
'a: 'async_lifetime,
[src]
&'async_lifetime mut self,
message: <Choice<N> as CallBy<'a, Val>>::Type
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_lifetime>> where
'a: 'async_lifetime,
impl<T, Convention: CallingConvention, C> Transmit<T, Convention> for Available<C> where
C: Transmit<T, Convention>,
[src]
C: Transmit<T, Convention>,
type Error = C::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,
[src]
&'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,
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]
T: Serialize + Sync,
F: Serializer + Unpin + Send,
F::Output: Send,
F::Error: Send,
E: Encoder<F::Output> + Send,
W: AsyncWrite + Unpin + Send,
This is supported on crate feature
serde
only.