ReadExt

Trait ReadExt 

Source
pub trait ReadExt: Read {
    // Required methods
    fn read_u64(&mut self) -> Result<u64, Error>;
    fn read_u32(&mut self) -> Result<u32, Error>;
    fn read_u16(&mut self) -> Result<u16, Error>;
    fn read_u8(&mut self) -> Result<u8, Error>;
    fn read_i64(&mut self) -> Result<i64, Error>;
    fn read_i32(&mut self) -> Result<i32, Error>;
    fn read_i16(&mut self) -> Result<i16, Error>;
    fn read_i8(&mut self) -> Result<i8, Error>;
    fn read_bool(&mut self) -> Result<bool, Error>;
    fn read_slice(&mut self, slice: &mut [u8]) -> Result<(), Error>;
}
Expand description

Extensions of Read to decode data as per Bitcoin consensus.

Required Methods§

Source

fn read_u64(&mut self) -> Result<u64, Error>

Reads a 64-bit unsigned integer.

Source

fn read_u32(&mut self) -> Result<u32, Error>

Reads a 32-bit unsigned integer.

Source

fn read_u16(&mut self) -> Result<u16, Error>

Reads a 16-bit unsigned integer.

Source

fn read_u8(&mut self) -> Result<u8, Error>

Reads an 8-bit unsigned integer.

Source

fn read_i64(&mut self) -> Result<i64, Error>

Reads a 64-bit signed integer.

Source

fn read_i32(&mut self) -> Result<i32, Error>

Reads a 32-bit signed integer.

Source

fn read_i16(&mut self) -> Result<i16, Error>

Reads a 16-bit signed integer.

Source

fn read_i8(&mut self) -> Result<i8, Error>

Reads an 8-bit signed integer.

Source

fn read_bool(&mut self) -> Result<bool, Error>

Reads a boolean.

Source

fn read_slice(&mut self, slice: &mut [u8]) -> Result<(), Error>

Reads a byte slice.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<R> ReadExt for R
where R: Read + ?Sized,