Trait BadLength

Source
pub trait BadLength {
    // Required method
    fn bad_length(found: usize, expected: usize) -> Self;
}
Expand description

Trait to be implemented for the associated Error used in [DeserializableSlice::from_slice]. The function is called if the slice given is smaller than the mandatory size for the struct.

Required Methods§

Source

fn bad_length(found: usize, expected: usize) -> Self

Invoked when a buffer of bad length is given to [from_slice]

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§