[][src]Struct async_bincode::AsyncBincodeReader

pub struct AsyncBincodeReader<R, T> { /* fields omitted */ }

A wrapper around an asynchronous reader that produces an asynchronous stream of bincode-decoded values.

To use, provide a reader that implements AsyncRead, and then use 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]

pub fn get_ref(&self) -> &R[src]

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]

Gets a mutable reference to the underlying reader.

It is inadvisable to directly read from the underlying reader.

pub fn buffer(&self) -> &[u8][src]

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]

Unwraps this AsyncBincodeReader, returning the underlying reader.

Note that any leftover data in the internal buffer is lost.

Trait Implementations

impl<R, T> Unpin for AsyncBincodeReader<R, T> where
    R: Unpin
[src]

impl<R, T> From<R> for AsyncBincodeReader<R, T>[src]

impl<R, T> Default for AsyncBincodeReader<R, T> where
    R: Default
[src]

impl<R: Debug, T: Debug> Debug for AsyncBincodeReader<R, T>[src]

impl<R, T> Stream for AsyncBincodeReader<R, T> where
    T: Deserialize<'a>,
    R: AsyncRead + Unpin
[src]

type Item = Result<T, Error>

Values yielded by the stream.

Auto Trait Implementations

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> UnwindSafe for AsyncBincodeReader<R, T> where
    R: UnwindSafe,
    T: UnwindSafe

impl<R, T> RefUnwindSafe for AsyncBincodeReader<R, T> where
    R: RefUnwindSafe,
    T: RefUnwindSafe

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<!> for T[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<S, T, E> TryStream for S where
    S: Stream<Item = Result<T, E>> + ?Sized
[src]

type Ok = T

The type of successful values yielded by this future

type Error = E

The type of failures yielded by this future