[−][src]Trait elrond_codec::Input
Trait that allows reading of data into a slice.
Required methods
fn remaining_len(&mut self) -> usize
Should return the remaining length of the input data. If no information about the input
length is available, None
should be returned.
The length is used to constrain the preallocation while decoding. Returning a garbage
length can open the doors for a denial of service attack to your application.
Otherwise, returning None
can decrease the performance of your application.
fn read_into(&mut self, into: &mut [u8]) -> Result<(), DecodeError>
Read the exact number of bytes required to fill the given buffer.
fn read_slice(&mut self, length: usize) -> Result<&[u8], DecodeError>
Read the exact number of bytes required to fill the given buffer.
fn flush(&mut self) -> Result<&[u8], DecodeError>
Provided methods
fn empty(&mut self) -> bool
fn read_byte(&mut self) -> Result<u8, DecodeError>
Read a single byte from the input.