Trait distant_net::UntypedTransportRead
source · [−]pub trait UntypedTransportRead: Send + Unpin {
fn read<'life0, 'async_trait, T>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<Option<T>>> + Send + 'async_trait>>
where
T: DeserializeOwned,
T: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait;
}
Expand description
Interface representing a transport’s read half that uses serde
to deserialize data as it is
received
Required Methods
Attempts to read some data as T
, returning io::Error
if unable to deserialize
or some other error occurs. Some(T)
is returned if successful. None
is
returned if no more data is available.