Trait VariableSizeObject

Source
pub trait VariableSizeObject {
    // Required method
    fn is_variable_size() -> bool;
}
Expand description

Trait for objects to derive in order to specify whether or not they are variable-size.

This trait does not strictly need to be implemented, however if your data structures contain dynamic-size fields, the quality of fuzzing may be slightly worse. This is because calling NewFuzzed::new_fuzzed will, if a variable-sized field is in the data structure, initialize its fields in a random order. If you are working with size constraints, it may be useful to #[derive(VariableSizeObject)] to get random field initialization.

Required Methods§

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.

Implementations on Foreign Types§

Source§

impl<T> VariableSizeObject for Vec<T>

Implementors§