# Trait ComputeSize

    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§

#### 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", so this trait is not object safe.

## Implementors§

§

### impl ComputeSize for InstanceRecord<'_>

§

### impl ComputeSize for BaseRecord<'_>

§

### impl ComputeSize for Class1Record<'_>

§

### impl ComputeSize for Class2Record

§

### impl ComputeSize for ComponentRecord<'_>

§

### impl ComputeSize for Mark2Record<'_>

§

### impl ComputeSize for PairValueRecord

§

### impl ComputeSize for ValueRecord

§

### impl ComputeSize for U16Or32

§

### impl ComputeSize for DeviceRecord<'_>

§

### impl ComputeSize for Tuple<'_>

§

### impl ComputeSize for VariationRegion<'_>