Enum MemoryPeerError
#[non_exhaustive]pub enum MemoryPeerError {
Poisoned,
BatchTooLarge {
actual: usize,
limit: usize,
},
BelowRetentionFloor {
floor: EventId,
from: Option<MemoryResume>,
},
}memory only.Expand description
How MemorySyncPeer fails.
Short, because an in-memory peer has almost no transport to fail. Each variant here is real: a poisoned lock, a push over the limits this peer declared, and a pull from below what its compaction forgot.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Poisoned
A previous holder of the lock panicked, so the log may be torn.
std::sync::PoisonError borrows the guard it came from, so it cannot be
carried in an owned error. Flattening it loses nothing here: there is no
recovery path for a torn in-memory log.
BatchTooLarge
The pushed batch exceeds the limits PeerLimits declared.
Present so that a runner which ignores limits() still gets a
distinguishable failure rather than a truncated log. Retrying the same
batch will fail identically; it has to be split.
BelowRetentionFloor
The pull’s token has not reached the newest event this peer’s compaction forgot, so the history between them is gone (SY-32).
Class Reseed: a retry fails the same
way for ever. The refused token is handed back.
Fields
floor: EventIdThe newest event compaction dropped, as
PeerLimits::retention_floor reports it.
from: Option<MemoryResume>The token that was refused. None is a pull from the start.
Trait Implementations§
§impl Classify for MemoryPeerError
impl Classify for MemoryPeerError
§fn class(&self) -> FailureClass
fn class(&self) -> FailureClass
§impl Debug for MemoryPeerError
impl Debug for MemoryPeerError
§impl Display for MemoryPeerError
impl Display for MemoryPeerError
§impl Error for MemoryPeerError
impl Error for MemoryPeerError
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()