Trait concordium_std::Read
source · pub trait Read {
// Required method
fn read(&mut self, buf: &mut [u8]) -> Result<usize, ParseError>;
// Provided methods
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), ParseError> { ... }
fn read_u64(&mut self) -> Result<u64, ParseError> { ... }
fn read_u32(&mut self) -> Result<u32, ParseError> { ... }
fn read_u16(&mut self) -> Result<u16, ParseError> { ... }
fn read_u8(&mut self) -> Result<u8, ParseError> { ... }
fn read_i64(&mut self) -> Result<i64, ParseError> { ... }
fn read_i32(&mut self) -> Result<i32, ParseError> { ... }
fn read_i16(&mut self) -> Result<i16, ParseError> { ... }
fn read_i8(&mut self) -> Result<i8, ParseError> { ... }
fn read_array<const N: usize>(&mut self) -> Result<[u8; N], ParseError> { ... }
}
Expand description
The Read
trait provides a means of reading from byte streams.
Required Methods§
Provided Methods§
sourcefn read_exact(&mut self, buf: &mut [u8]) -> Result<(), ParseError>
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), ParseError>
Read exactly the required number of bytes. If not enough bytes could be
read the function returns Err(_)
, and the contents of the given buffer
is unspecified.
sourcefn read_u64(&mut self) -> Result<u64, ParseError>
fn read_u64(&mut self) -> Result<u64, ParseError>
Read a u64
in little-endian format.
sourcefn read_u32(&mut self) -> Result<u32, ParseError>
fn read_u32(&mut self) -> Result<u32, ParseError>
Read a u32
in little-endian format.
sourcefn read_u16(&mut self) -> Result<u16, ParseError>
fn read_u16(&mut self) -> Result<u16, ParseError>
Read a u16
in little-endian format.
sourcefn read_u8(&mut self) -> Result<u8, ParseError>
fn read_u8(&mut self) -> Result<u8, ParseError>
Read a u8
.
sourcefn read_i64(&mut self) -> Result<i64, ParseError>
fn read_i64(&mut self) -> Result<i64, ParseError>
Read a i64
in little-endian format.
sourcefn read_i32(&mut self) -> Result<i32, ParseError>
fn read_i32(&mut self) -> Result<i32, ParseError>
Read a i32
in little-endian format.
sourcefn read_i16(&mut self) -> Result<i16, ParseError>
fn read_i16(&mut self) -> Result<i16, ParseError>
Read a i16
in little-endian format.
sourcefn read_i8(&mut self) -> Result<i8, ParseError>
fn read_i8(&mut self) -> Result<i8, ParseError>
Read a i32
in little-endian format.
sourcefn read_array<const N: usize>(&mut self) -> Result<[u8; N], ParseError>
fn read_array<const N: usize>(&mut self) -> Result<[u8; N], ParseError>
Load an array of the given size.
Object Safety§
This trait is not object safe.
Implementors§
impl Read for ExternCallResponse
The read implementation uses host functions to read chunks of return value on demand.