Function il2_iltags::tags::tag_size_to_usize[][src]

pub fn tag_size_to_usize(size: u64) -> Result<usize>
Expand description

This function converts the tag size as u64 into a usize value. It checks if the tag size falls within the maximum size of a tag that this library accepts.

It can be used to detect potential corruptions in the data stream.

Arguments:

  • size: The size read from the tag.

Returns:

  • Ok(size): The size as u64;
  • Err(ErrorKind::TagTooLarge): If the tag is too large;