#[non_exhaustive]pub enum HlcError {
Length(usize),
NodeIdTooLarge(u64),
PeerTooFarAhead {
ahead_micros: i64,
max_micros: i64,
},
CounterOverflow,
}Expand description
Why a hybrid logical clock operation failed.
No variant holds the input bytes that failed. A peer controls the value of
the krabka.hlc header, and a message that keeps those bytes would put
hostile input into the log field that shows the error. The variants carry
lengths, counts, and time deltas only.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Length(usize)
The header value is not exactly HLC_ENCODED_LEN bytes.
NodeIdTooLarge(u64)
The node id is wider than the 4 bytes the layout gives it.
NodeId holds a u64, and Kafka carries the same value as a 4-byte
wire field. A node id above u32::MAX has no place in the layout, so
the encode fails instead of a silent truncation.
PeerTooFarAhead
The peer’s wall time is further ahead of the local physical clock than the configured maximum offset, so the clock refused the stamp.
Fields
CounterOverflow
The logical counter reached u32::MAX inside one microsecond.
The counter separates events that share a wall-time microsecond. It never wraps, because a wrap would put a later event before an earlier one.
Trait Implementations§
impl Copy for HlcError
impl Eq for HlcError
Source§impl Error for HlcError
impl Error for HlcError
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()