Skip to main content

ComputeSize

Trait ComputeSize 

Source
pub trait ComputeSize: ReadArgs {
    // Required method
    fn compute_size(args: &Self::Args) -> Result<usize, ReadError>;
}
Expand description

A type that can compute its size at runtime, based on some input.

For types with a constant size, see FixedSize and for types which store their size inline, see VarSize.

Required Methods§

Source

fn compute_size(args: &Self::Args) -> Result<usize, ReadError>

Compute the number of bytes required to represent this type.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§