[−][src]Trait elrond_codec::NestedDecodeInput
Trait that allows reading of data into a slice.
Required methods
pub fn remaining_len(&mut self) -> usize
[src]
The remaining length of the input data.
pub fn read_into(&mut self, into: &mut [u8]) -> Result<(), DecodeError>
[src]
Read the exact number of bytes required to fill the given buffer.
pub fn read_into_or_exit<ExitCtx: Clone>(
&mut self,
into: &mut [u8],
c: ExitCtx,
exit: fn(_: ExitCtx, _: DecodeError) -> !
)
[src]
&mut self,
into: &mut [u8],
c: ExitCtx,
exit: fn(_: ExitCtx, _: DecodeError) -> !
)
Read the exact number of bytes required to fill the given buffer. Exit early if there are not enough bytes to fill the result.
pub fn read_slice(&mut self, length: usize) -> Result<&[u8], DecodeError>
[src]
Read the exact number of bytes required to fill the given buffer.
pub fn read_slice_or_exit<ExitCtx: Clone>(
&mut self,
length: usize,
c: ExitCtx,
exit: fn(_: ExitCtx, _: DecodeError) -> !
) -> &[u8]
[src]
&mut self,
length: usize,
c: ExitCtx,
exit: fn(_: ExitCtx, _: DecodeError) -> !
) -> &[u8]
Read the exact number of bytes required to fill the given buffer. Exit directly if the input contains too few bytes.
pub fn flush(&mut self) -> &[u8]
[src]
Clears the input buffer and returns all remaining bytes.
Provided methods
pub fn empty(&mut self) -> bool
[src]
pub fn read_byte(&mut self) -> Result<u8, DecodeError>
[src]
Read a single byte from the input.
pub fn read_byte_or_exit<ExitCtx: Clone>(
&mut self,
c: ExitCtx,
exit: fn(_: ExitCtx, _: DecodeError) -> !
) -> u8
[src]
&mut self,
c: ExitCtx,
exit: fn(_: ExitCtx, _: DecodeError) -> !
) -> u8
Read a single byte from the input.
Implementors
impl<'a> NestedDecodeInput for &'a [u8]
[src]
pub fn remaining_len(&mut self) -> usize
[src]
pub fn read_into(&mut self, into: &mut [u8]) -> Result<(), DecodeError>
[src]
pub fn read_into_or_exit<ExitCtx: Clone>(
&mut self,
into: &mut [u8],
c: ExitCtx,
exit: fn(_: ExitCtx, _: DecodeError) -> !
)
[src]
&mut self,
into: &mut [u8],
c: ExitCtx,
exit: fn(_: ExitCtx, _: DecodeError) -> !
)
pub fn read_slice(&mut self, length: usize) -> Result<&[u8], DecodeError>
[src]
pub fn read_slice_or_exit<ExitCtx: Clone>(
&mut self,
length: usize,
c: ExitCtx,
exit: fn(_: ExitCtx, _: DecodeError) -> !
) -> &[u8]
[src]
&mut self,
length: usize,
c: ExitCtx,
exit: fn(_: ExitCtx, _: DecodeError) -> !
) -> &[u8]