Function binary_utils::read_byte

source ·
pub async fn read_byte(
    reader: &mut (impl AsyncRead + Unpin),
    line: u32,
    file: &'static str
) -> Result<u8>
Expand description

Reads a single byte asyncronously from the provided reader

§Arguments

reader - A mutable reference to a type implemnting AsyncRead and Unpin line - A line number, where the function is called file - A static string slice containing the name of the file, where the function was called

§Returns

Returns an binary_utils::Result containing the byte or an error if the reading failed

§Errors

This function can fail, if there is no data in the provided reader to read.