pub trait DivisIterable<T> {
type Iter<'a>: ExactSizeIterator<Item = &'a T>
where Self: 'a,
T: 'a;
// Required method
fn divide(&self) -> Self::Iter<'_>;
}Expand description
Divides an underlier type into smaller underliers in memory and iterates over them.
DivisIterable (say that 10 times, fast) provides iteration over the subdivisions of an
underlier type, guaranteeing that iteration proceeds from the least significant bits to the most
significant bits, regardless of the CPU architecture’s endianness.
§Endianness Handling
To ensure consistent LSB-to-MSB iteration order across all platforms:
- On little-endian systems: elements are naturally ordered LSB-to-MSB in memory, so iteration proceeds forward through the array
- On big-endian systems: elements are ordered MSB-to-LSB in memory, so iteration is reversed to achieve LSB-to-MSB order
This abstraction allows code to work with subdivided underliers in a platform-independent way while maintaining the invariant that the first element always represents the least significant portion of the value.
Required Associated Types§
type Iter<'a>: ExactSizeIterator<Item = &'a T> where Self: 'a, T: 'a
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.