Trait il2_iltags::io::array::MemoryReader[][src]

pub trait MemoryReader: Reader {
    fn len(&self) -> usize;
fn offset(&self) -> usize;
fn set_offset(&mut self, offset: usize); fn is_empty(&self) -> bool { ... }
fn available(&self) -> usize { ... }
fn assert_can_read(&self, count: usize) -> Result<()> { ... } }
Expand description

This trait provides an extension to Reader for memory backed readers.

New since 1.4.0.

Required methods

Returns the current size of the data.

Returns the current offset of the data.

Sets the current offset. If offset is larger than the length, it will set the offset to to the length of the data.

Provided methods

Returns true if this reader is empty.

Returns the number of bytes available in the reader.

This method verifies if a certain amount of bytes can be read/extracted.

Arguments:

  • count: Number of bytes to read;

Retunrs:

  • Ok(()): If it is possible to read the specified amout of bytes;
  • Err(ErrorKind::UnableToReadData): If there is not enough bytes to read;
  • Err(ErrorKind::EndOfData): If there is no more data to read;

Implementors