Skip to main content

FixedBitLen

Trait FixedBitLen 

Source
pub trait FixedBitLen {
    const BIT_LEN: u32;
}
Expand description

A message whose encoded length is a compile-time constant — i.e. it has no variable-length (count-driven Vec) field. The derive implements this only for fixed messages; it sizes a fixed byte region when the message is embedded in a byte stream (e.g. a #[nested] field’s contribution to its parent’s width). A count-bearing message implements BitDecode/BitEncode but not this.

Required Associated Constants§

Source

const BIT_LEN: u32

Total encoded width of the message in bits — the sum of its fields’ widths.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§