Trait async_serialization::AsyncDeserialize
[−]
[src]
pub trait AsyncDeserialize<R: AsyncRead>: Sized { type DeserializeFuture: Future<Item = (R, Self, usize), Error = (R, DeserializeError<Self::Error>)>; type Error; fn deserialize_future(reader: R) -> Self::DeserializeFuture; fn already_read(&self) -> usize; }
A type whose values can be deserialized from an AsyncRead
.
Associated Types
type DeserializeFuture: Future<Item = (R, Self, usize), Error = (R, DeserializeError<Self::Error>)>
The future that performs the deserialization. It yields back ownership of the wrapped reader, the deserialized value, and the number of bytes it read from the reader.
type Error
The error that is emitted when reading invalid data.
Required Methods
fn deserialize_future(reader: R) -> Self::DeserializeFuture
Consume a reader to create a DeserializeFuture
.
fn already_read(&self) -> usize
Return how many bytes have already been read.