[−][src]Struct async_bincode::AsyncBincodeReader
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]
R: Unpin,
impl<R, T> From<R> for AsyncBincodeReader<R, T>
[src]
impl<R, T> Default for AsyncBincodeReader<R, T> where
R: Default,
[src]
R: Default,
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]
T: Deserialize<'a>,
R: AsyncRead + Unpin,
Auto Trait Implementations
impl<R, T> Send for AsyncBincodeReader<R, T> where
R: Send,
T: Send,
R: Send,
T: Send,
impl<R, T> Sync for AsyncBincodeReader<R, T> where
R: Sync,
T: Sync,
R: Sync,
T: Sync,
impl<R, T> UnwindSafe for AsyncBincodeReader<R, T> where
R: UnwindSafe,
T: UnwindSafe,
R: UnwindSafe,
T: UnwindSafe,
impl<R, T> RefUnwindSafe for AsyncBincodeReader<R, T> where
R: RefUnwindSafe,
T: RefUnwindSafe,
R: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> From<!> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<S, T, E> TryStream for S where
S: Stream<Item = Result<T, E>> + ?Sized,
[src]
S: Stream<Item = Result<T, E>> + ?Sized,