Skip to main content

read_partial_int

Function read_partial_int 

Source
pub fn read_partial_int<R: Read>(
    stream: &mut R,
    bytes: u8,
    present_bytes: &mut u8,
) -> Result<usize>
Expand description

Reads a partial integer from a stream. (little-endian order)

§Arguments

  • stream - A mutable reference to a readable stream.
  • bytes - The number of bytes to read from the stream.
  • present_bytes - A mutable reference to a byte indicating which bits are present in the integer value.

§Returns

This function returns a result of type io::Result<usize>. If the operation is successful, the integer value read from the stream is returned as Ok(value). Otherwise, an Err variant is returned, wrapping an io::Error that describes the specific error that occurred.