Struct il2_iltags::io::LimitedReader[][src]

pub struct LimitedReader<'a> { /* fields omitted */ }
Expand description

The LimitedReader implements a Reader that wraps another Reader but defines a limited to the amount of bytes that can be extracted from it.

This wrapper was designed to ease the implementation of the deserialization of the tags.

It is important to notice that LimitedReader will test the limits prior to the attempt to read the data, thus failed attempts will not consume data from the inner reader.

Implementations

Creates a new instance of this struct.

Parameters:

  • src: A mutable reference to the source Reader.
  • available: Number of bytes available for reading.

Verifies if it is possible to extract a given number of bytes from the source.

Parameters:

  • size: The number of bytes to read.

Returns:

  • Ok(()): On success.
  • Err(ErrorKind): If the specified number of bytes is not available.

Returns the number of available bytes.

Returns:

  • The number of available bytes.

Skips the required number of bytes required to achive the end of the specified limit.

Returns:

  • Ok(()): On success.
  • Err(ErrorKind): If the specified number of bytes is not available.

Verifies if the this reader is empty.

Returns:

  • true: if it is empty;
  • false: if it is not empty;

Trait Implementations

Reads a single byte from the source. Read more

Reads the specified number of bytes from the source. Read more

Skips some bytes from the source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Reads the ILInt. Read more

Performs the conversion.

Reads an UTF-8 String with a given size. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Reads the value. Read more

Reads the value. Read more

Reads the value. Read more

Reads the value. Read more

Reads the value. Read more

Reads the value. Read more

Reads the value. Read more

Reads the value. Read more

Reads the value. Read more

Reads the value. Read more