Struct grin_core::ser::BinReader [−][src]
pub struct BinReader<'a, R: Read> { /* fields omitted */ }
Utility to read from a binary source
Implementations
impl<'a, R: Read> BinReader<'a, R>
[src]
impl<'a, R: Read> BinReader<'a, R>
[src]pub fn new(source: &'a mut R, version: ProtocolVersion) -> Self
[src]
pub fn new(source: &'a mut R, version: ProtocolVersion) -> Self
[src]Constructor for a new BinReader for the provided source and protocol version.
Trait Implementations
impl<'a, R: Read> Reader for BinReader<'a, R>
[src]
impl<'a, R: Read> Reader for BinReader<'a, R>
[src]Utility wrapper for an underlying byte Reader. Defines higher level methods to read numbers, byte vectors, hashes, etc.
fn read_bytes_len_prefix(&mut self) -> Result<Vec<u8>, Error>
[src]
fn read_bytes_len_prefix(&mut self) -> Result<Vec<u8>, Error>
[src]Read a variable size vector from the underlying Read. Expects a usize
fn read_fixed_bytes(&mut self, len: usize) -> Result<Vec<u8>, Error>
[src]
fn read_fixed_bytes(&mut self, len: usize) -> Result<Vec<u8>, Error>
[src]Read a fixed number of bytes.
fn expect_u8(&mut self, val: u8) -> Result<u8, Error>
[src]
fn expect_u8(&mut self, val: u8) -> Result<u8, Error>
[src]Consumes a byte from the reader, producing an error if it doesn’t have the expected value Read more
fn protocol_version(&self) -> ProtocolVersion
[src]
fn protocol_version(&self) -> ProtocolVersion
[src]Access to underlying protocol version to support version specific deserialization logic. Read more
Auto Trait Implementations
impl<'a, R> RefUnwindSafe for BinReader<'a, R> where
R: RefUnwindSafe,
R: RefUnwindSafe,
impl<'a, R> Send for BinReader<'a, R> where
R: Send,
R: Send,
impl<'a, R> Sync for BinReader<'a, R> where
R: Sync,
R: Sync,
impl<'a, R> Unpin for BinReader<'a, R>
impl<'a, R> !UnwindSafe for BinReader<'a, R>
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> UnsafeAny for T where
T: Any,
T: Any,