pub enum Error {
CapacityExceeded {
max_bytes: usize,
},
BadSlot {
size: usize,
key_len: usize,
},
BadShardCount {
got: usize,
},
BlobTooLarge {
len: usize,
max_blob: usize,
},
ValueTooLarge {
len: usize,
},
Corrupt(&'static str),
}Expand description
Errors returned by storage operations. No operation in this crate panics on resource exhaustion — capacity problems are always typed errors. (Contract violations — a wrong key length, an out-of-range id — panic, because they are caller bugs, not runtime conditions; each method documents its panics.)
Variants§
CapacityExceeded
Growing a byte pool would exceed the structure’s configured
max_bytes ceiling.
BadSlot
The Slot layout constants are invalid.
BadShardCount
ArenaCfg::shards is not a non-zero power
of two.
BlobTooLarge
A blob passed to BlobHeap::push is longer
than the configured max_blob.
ValueTooLarge
A value passed to ChunkPool::push is
longer than a chunk’s payload (CHUNK_PAYLOAD bytes) and can never
fit without crossing a chunk boundary.
Corrupt(&'static str)
A serialized image failed load-time validation (load methods).
The message names the violated invariant. Loading never panics on arbitrary bytes — every inconsistency maps to this variant.
Trait Implementations§
impl Copy for Error
impl Eq for Error
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()