Function il2_iltags::tags::util::limited_reader_ensure_empty[][src]

pub fn limited_reader_ensure_empty(
    reader: &LimitedReader<'_>,
    on_error_kind: ErrorKind
) -> Result<()>
Expand description

This helper function tests if the given LimitedReader is empty and return the specified result according to the status of the reader. It is very useful to implement the final verification for certain tag deserialization procedures.

Arguments:

  • on_error_kind: The type of error to return if the reader is not empty;

Returns:

  • Ok(()): if the reader is empty;
  • Err(on_error_kind): if the reader is not empty;