pub struct BufReader<'a, B: Buf> { /* private fields */ }
Expand description
Protocol version-aware wrapper around a Buf
impl
Implementations§
Trait Implementations§
source§impl<'a, B: Buf> Reader for BufReader<'a, B>
impl<'a, B: Buf> Reader for BufReader<'a, B>
source§fn deserialization_mode(&self) -> DeserializationMode
fn deserialization_mode(&self) -> DeserializationMode
The mode this reader is reading from
source§fn read_bytes_len_prefix(&mut self) -> Result<Vec<u8>, Error>
fn read_bytes_len_prefix(&mut self) -> Result<Vec<u8>, Error>
Read a u64 len prefix followed by that number of exact bytes.
source§fn read_fixed_bytes(&mut self, len: usize) -> Result<Vec<u8>, Error>
fn read_fixed_bytes(&mut self, len: usize) -> Result<Vec<u8>, Error>
Read a fixed number of bytes from the underlying reader.
source§fn expect_u8(&mut self, val: u8) -> Result<u8, Error>
fn expect_u8(&mut self, val: u8) -> Result<u8, Error>
Consumes a byte from the reader, producing an error if it doesn’t have
the expected value
source§fn protocol_version(&self) -> ProtocolVersion
fn protocol_version(&self) -> ProtocolVersion
Access to underlying protocol version to support
version specific deserialization logic.
Auto Trait Implementations§
impl<'a, B> Freeze for BufReader<'a, B>
impl<'a, B> RefUnwindSafe for BufReader<'a, B>where
B: RefUnwindSafe,
impl<'a, B> Send for BufReader<'a, B>where
B: Send,
impl<'a, B> Sync for BufReader<'a, B>where
B: Sync,
impl<'a, B> Unpin for BufReader<'a, B>
impl<'a, B> !UnwindSafe for BufReader<'a, B>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more