Struct async_bincode::AsyncBincodeReader [−][src]
A wrapper around an asynchronous reader that produces an asynchronous stream of bincode-decoded values.
To use, provide a reader that implements tokio::io::AsyncRead
, and then use futures::Stream
to access the deserialized values.
Note that the sender must prefix each serialized item with its size as reported by
bincode::serialized_size
encoded as a four-byte network-endian encoded. See also
serialize_into
, which does this for you.
Methods
impl<R, T> AsyncBincodeReader<R, T>
[src]
[−]
impl<R, T> AsyncBincodeReader<R, T>
pub fn get_ref(&self) -> &R
[src]
[−]
pub fn get_ref(&self) -> &R
Gets a reference to the underlying reader.
It is inadvisable to directly read from the underlying reader.
pub fn get_mut(&mut self) -> &mut R
[src]
[−]
pub fn get_mut(&mut self) -> &mut R
Gets a mutable reference to the underlying reader.
It is inadvisable to directly read from the underlying reader.
pub fn buffer(&self) -> &[u8]
[src]
[−]
pub fn buffer(&self) -> &[u8]
Returns a reference to the internally buffered data.
This will not attempt to fill the buffer if it is empty.
pub fn into_inner(self) -> R
[src]
[−]
pub fn into_inner(self) -> R
Unwraps this AsyncBincodeReader
, returning the underlying reader.
Note that any leftover data in the internal buffer is lost.
Trait Implementations
impl<R: Debug, T: Debug> Debug for AsyncBincodeReader<R, T>
[src]
[+]
impl<R: Debug, T: Debug> Debug for AsyncBincodeReader<R, T>
impl<R, T> Default for AsyncBincodeReader<R, T> where
R: Default,
[src]
[+]
impl<R, T> Default for AsyncBincodeReader<R, T> where
R: Default,
impl<R, T> From<R> for AsyncBincodeReader<R, T>
[src]
[+]
impl<R, T> From<R> for AsyncBincodeReader<R, T>
impl<R, T> Stream for AsyncBincodeReader<R, T> where
T: Deserialize<'a>,
R: AsyncRead,
[src]
[+]
impl<R, T> Stream for AsyncBincodeReader<R, T> where
T: Deserialize<'a>,
R: AsyncRead,
Auto Trait Implementations
impl<R, T> Send for AsyncBincodeReader<R, T> where
R: Send,
T: Send,
impl<R, T> Send for AsyncBincodeReader<R, T> where
R: Send,
T: Send,
impl<R, T> Sync for AsyncBincodeReader<R, T> where
R: Sync,
T: Sync,
impl<R, T> Sync for AsyncBincodeReader<R, T> where
R: Sync,
T: Sync,