Trait NotEnoughBytesErr

Source
pub trait NotEnoughBytesErr {
    // Required method
    fn not_enough_bytes(
        context: &'static str,
        received: usize,
        expected: usize,
    ) -> Self;
}
Expand description

Trait for creating “not enough bytes” errors.

Required Methods§

Source

fn not_enough_bytes( context: &'static str, received: usize, expected: usize, ) -> Self

Creates a new “not enough bytes” error.

§Arguments
  • context - The context in which the error occurred.
  • received - The number of bytes received.
  • expected - The number of bytes expected.
§Returns

A new error instance.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§