pub enum KvError {
NotConnected,
ConnectionFailed(String),
KeyNotFound,
AlreadyExists,
RevisionMismatch,
DeserializationError(String),
SerializationError(String),
WatchError(String),
OperationFailed(String),
Timeout,
CursorExpired,
}Expand description
Error type for KV operations.
KvError is Clone so a single failure can fan out to multiple waiters
(e.g. callers blocked on a shared connect result). The underlying backend
errors — std::io::Error, the async-nats error types — are not Clone,
so their detail is flattened into the message string at this boundary rather
than retained as a #[source] cause. Keeping KvError: Clone across the
object-safe async_trait surface is the deliberate trade-off; the cost is a
structured cause chain, which is why the String variants carry pre-rendered
context instead of a nested error.
Variants§
NotConnected
ConnectionFailed(String)
KeyNotFound
AlreadyExists
Key already exists (create-if-not-exists conflict).
RevisionMismatch
CAS conflict: current version doesn’t match expected.
DeserializationError(String)
SerializationError(String)
WatchError(String)
OperationFailed(String)
Timeout
CursorExpired
The watch cursor/revision is too old — the backend has compacted past it. Callers should fall back to a full scan + watch.
Trait Implementations§
Source§impl Error for KvError
impl Error for KvError
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()