Module extensions

Module extensions 

Source
Expand description

Extension traits for ergonomic operations on encoding and decoding.

These traits provide convenience methods (like read(), decode(), read_range(), and decode_range()) that simplify common use cases of the core Read and Decode traits, particularly when default configurations (()) or RangeCfg are involved.

Traitsยง

DecodeExt
Extension trait providing ergonomic decode method for types requiring no specific configuration. This is typically types with only one possible value, such as the unit type () or tuples of such types.
DecodeRangeExt
Extension trait for reading types whose config is (RangeCfg<usize>, X) where X is IsUnit, ensuring the buffer is consumed.
IsUnit
Trait for types that are unit-like, i.e. have only one possible value.
ReadExt
Extension trait providing ergonomic read method for types requiring no configuration (i.e. Cfg = ()).
ReadRangeExt
Extension trait for reading types whose config is (RangeCfg<usize>, X) where X is Default.