#[non_exhaustive]pub enum KvError {
Io(Error),
Decode(Error),
InvalidKey(String),
ValueTooLong {
key: String,
len: usize,
},
FutureVersion(u32),
}Expand description
Error type returned by this module.
#[non_exhaustive]: shep-core is a published library and this enum is
reachable from it, so a further failure shape — a store whose size exceeded
a future cap, say — must not break an out-of-tree consumer’s match
(IR-20).
Wraps io::Error/serde_json::Error directly rather than stringifying
them, matching BarkError, so callers keep the
underlying diagnostic through core::error::Error::source — at the cost,
documented there too, of not deriving Clone/PartialEq/Eq (IR-19’s
exception for variants wrapping io::Error).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Io(Error)
The store could not be read, written, or replaced.
Decode(Error)
The store’s JSON could not be parsed.
Refused rather than repaired: unlike barks.jsonl, which is read during
an incident and so forgives a bad line, this file is a map an operator
wrote and a partial read of it would silently drop keys that are still
on disk.
InvalidKey(String)
A key outside the grammar; carries it verbatim so the message can quote what was typed.
ValueTooLong
A value over MAX_VALUE_BYTES.
FutureVersion(u32)
The store on disk is a version this build does not understand; carries that version. Nothing was written.
Trait Implementations§
Source§impl Error for KvError
impl Error for KvError
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()