pub enum MemoryLayoutError {
MisalignedMemory,
CapacityExceeded,
}Expand description
Errors that can occur when converting memory into a MemVec.
These errors indicate fundamental incompatibilities between the memory layout
and the target type T. When these errors occur, the original memory is returned
unchanged, allowing for recovery or alternative handling.
Variants§
MisalignedMemory
The memory is not properly aligned for the target type T.
This occurs when the memory address is not aligned to the alignment
requirements of type T. Common causes include memory-mapped files
that don’t start on proper boundaries or custom memory implementations
with incorrect alignment.
CapacityExceeded
The logical length stored in memory exceeds the available capacity.
This occurs when the memory claims to contain more elements than can physically fit in the allocated space. Common causes include corrupted metadata in file-backed storage, version incompatibility, or bugs in length management.
Trait Implementations§
Source§impl Clone for MemoryLayoutError
impl Clone for MemoryLayoutError
Source§fn clone(&self) -> MemoryLayoutError
fn clone(&self) -> MemoryLayoutError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more