#[non_exhaustive]pub enum Error {
Show 14 variants
InvalidPartitionOffset,
InvalidPartitionSize,
FlashError,
NamespaceNotFound,
NamespaceTooLong,
NamespaceMalformed,
ValueTooLong,
KeyMalformed,
KeyTooLong,
KeyNotFound,
ItemTypeMismatch(ItemType),
CorruptedData,
FlashFull,
PageFull,
}Expand description
Errors that can occur during NVS operations. The list is likely to stay as is but marked as non-exhaustive to allow for future additions without breaking the API. A caller would likely only need to handle NamespaceNotFound and KeyNotFound as the other errors are static.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidPartitionOffset
The partition offset has to be aligned to the size of a flash sector (4k)
InvalidPartitionSize
The partition size has to be a multiple of the flash sector size (4k)
FlashError
The internal error value is returned from the provided &mut impl flash::Flash
NamespaceNotFound
Namespace not found. Either the flash was corrupted and silently fixed on startup or no value has been written yet.
NamespaceTooLong
The max namespace length is 15 bytes plus null terminator.
NamespaceMalformed
The namespace is malformed. The last byte must be b’\0’
ValueTooLong
Strings are limited to MAX_BLOB_DATA_PER_PAGE while blobs can be up to MAX_BLOB_SIZE bytes
KeyMalformed
The key is malformed. The last byte must be b’\0’
KeyTooLong
The max key length is 15 bytes plus null terminator.
KeyNotFound
Key not found. Either the flash was corrupted and silently fixed on or no value has been written yet.
ItemTypeMismatch(ItemType)
The encountered item type is reported
CorruptedData
Blob data is corrupted or inconsistent
FlashFull
Flash is full and defragmentation doesn’t help.
PageFull
Used internally to indicate that we have to allocate a new page.