[−][src]Trait dialectic::backend::Receive
If a transport is Receive<T>
, we can use it to recv
a message of type T
.
In order to support the Chan::offer
method, all backends must
implement Receive<Choice<N>>
, in addition to whatever other types they support. For more
information, see Choice
.
Examples
For an example of implementing Receive
, check out the source for the implementation of
Receive
for mpsc::Receiver
.
Associated Types
Loading content...Required methods
pub fn recv<'async_lifetime>(
&'async_lifetime mut self
) -> Pin<Box<dyn Future<Output = Result<T, Self::Error>> + Send + 'async_lifetime>>
[src]
&'async_lifetime mut self
) -> Pin<Box<dyn Future<Output = Result<T, Self::Error>> + Send + 'async_lifetime>>
Receive a message. This may require type annotations for disambiguation.
Implementors
impl<'a, T: Send + Any> Receive<T> for dialectic::backend::mpsc::Receiver<'a>
[src]
This is supported on crate feature
mpsc
only.type Error = RecvError
pub fn recv<'async_lifetime>(
&'async_lifetime mut self
) -> Pin<Box<dyn Future<Output = Result<T, Self::Error>> + Send + 'async_lifetime>>
[src]
&'async_lifetime mut self
) -> Pin<Box<dyn Future<Output = Result<T, Self::Error>> + Send + 'async_lifetime>>
impl<'a, T: Send + Any> Receive<T> for UnboundedReceiver<'a>
[src]
This is supported on crate feature
mpsc
only.type Error = RecvError
pub fn recv<'async_lifetime>(
&'async_lifetime mut self
) -> Pin<Box<dyn Future<Output = Result<T, Self::Error>> + Send + 'async_lifetime>>
[src]
&'async_lifetime mut self
) -> Pin<Box<dyn Future<Output = Result<T, Self::Error>> + Send + 'async_lifetime>>
impl<T, C> Receive<T> for Available<C> where
C: Receive<T>,
[src]
C: Receive<T>,
type Error = C::Error
pub fn recv<'async_lifetime>(
&'async_lifetime mut self
) -> Pin<Box<dyn Future<Output = Result<T, Self::Error>> + Send + 'async_lifetime>>
[src]
&'async_lifetime mut self
) -> Pin<Box<dyn Future<Output = Result<T, Self::Error>> + Send + 'async_lifetime>>
impl<T, F, D, R> Receive<T> for dialectic::backend::serde::Receiver<F, D, R> where
T: for<'a> Deserialize<'a>,
F: Deserializer<D::Item> + Unpin + Send,
D: Decoder + Send,
R: AsyncRead + Unpin + Send,
[src]
T: for<'a> Deserialize<'a>,
F: Deserializer<D::Item> + Unpin + Send,
D: Decoder + Send,
R: AsyncRead + Unpin + Send,
This is supported on crate feature
serde
only.