#[non_exhaustive]pub enum Error {
Show 23 variants
Flash(NorFlashErrorKind),
NotMounted,
AlreadyMounted,
PayloadTooLarge,
BufferTooSmall,
CorruptEntry,
NoSpace,
InvalidConfig,
TooManySectors,
SizeMismatch {
expected: usize,
actual: usize,
},
SchemaMismatch {
expected: u8,
found: u8,
},
InvalidData,
InvalidRun,
Overflow,
NotAttached,
AlreadyAttached,
VolumeLost,
ForeignVolume {
expected: u32,
found: u32,
},
UnsupportedVersion {
found: u8,
},
GeometryMismatch,
CorruptCursor,
ReadsUnavailable,
RegionOverlap {
db_base: u32,
db_end: u32,
},
}Expand description
Database error type.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Flash(NorFlashErrorKind)
Flash operation failed.
NotMounted
Database is not mounted.
AlreadyMounted
Database is already mounted.
PayloadTooLarge
Payload exceeds maximum size for a single entry.
BufferTooSmall
Provided buffer is too small for the entry payload.
CorruptEntry
Entry CRC mismatch or invalid marker.
NoSpace
No space available in flash (all sectors full or reserved).
InvalidConfig
Invalid configuration parameters.
TooManySectors
Sector count exceeds MAX_SECTORS const generic.
SizeMismatch
Data size does not match expected type size.
Fields
SchemaMismatch
The entry was written under a different schema version of its type.
The struct bound to this sensor ID has changed since the entry was
stored. See SensorData::SCHEMA_VERSION
for how to read both eras out of one log.
Fields
InvalidData
Failed to interpret bytes as the target type.
InvalidRun
A Run’s parameters cannot be encoded as a single entry.
The sample slice was empty or longer than u16::MAX, the sample type is
zero-sized, the last sample’s timestamp would overflow u64, or the
frame would exceed the u16 payload length an entry header can carry.
Whether the run fits a flash page is a separate question, answered by
PayloadTooLarge.
Overflow
Arithmetic overflow in offset calculation.
NotAttached
No removable volume is attached.
AlreadyAttached
A volume is already attached; detach it first.
VolumeLost
The volume disappeared or faulted mid-operation.
Detach and re-attach to recover. Note that a genuine flash fault on the
medium is indistinguishable from removal at the driver level, so this is
a policy verdict rather than a hardware report — see
Removable for drivers that can tell the difference.
ForeignVolume
The volume belongs to a different logical log.
Returned instead of treating the medium as blank, which would erase another device’s data.
Fields
UnsupportedVersion
The medium is formatted with a version this build cannot read.
GeometryMismatch
Source and destination geometries are incompatible for replication.
The destination’s page size must be at least the source’s, or entries near the source’s maximum payload could never be copied.
CorruptCursor
The on-medium replication cursor is unreadable or structurally invalid.
This database was mounted without a full index and cannot serve reads.
RegionOverlap
The requested flash region intersects the database’s own sectors.
Raised by SensorDb::with_region and its
async counterpart, which broker access to other things living on the
same chip. Writing inside the database region behind the database’s back
corrupts the log, and the damage would not surface until a later mount.
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()