Macro not_enough_bytes_err

Source
macro_rules! not_enough_bytes_err {
    ( $context:expr, $received:expr , $expected:expr $(,)? ) => { ... };
    ( $received:expr , $expected:expr $(,)? ) => { ... };
}
Expand description

Creates a “not enough bytes” error with context information.

This macro generates an error indicating that there weren’t enough bytes in a buffer for a particular operation.

§Arguments

  • context - The context in which the error occurred (optional)
  • received - The number of bytes actually received
  • expected - The number of bytes expected

§Examples

use ironrdp_core::not_enough_bytes_err;

let err = not_enough_bytes_err!("parsing header", 5, 10);

§Note

If the context is not provided, it will use the current function name.