Trait fuel_types::canonical::Input
source · pub trait Input {
// Required methods
fn remaining(&mut self) -> usize;
fn peek(&self, buf: &mut [u8]) -> Result<(), Error>;
fn read(&mut self, buf: &mut [u8]) -> Result<(), Error>;
fn skip(&mut self, n: usize) -> Result<(), Error>;
// Provided methods
fn peek_byte(&mut self) -> Result<u8, Error> { ... }
fn read_byte(&mut self) -> Result<u8, Error> { ... }
}
Expand description
Allows reading of data into a slice.
Required Methods§
sourcefn peek(&self, buf: &mut [u8]) -> Result<(), Error>
fn peek(&self, buf: &mut [u8]) -> Result<(), Error>
Peek the exact number of bytes required to fill the given buffer.