pub enum ValidationError {
RunIdMismatch {
expected: RunId,
found: RunId,
},
NonContiguousSeq {
expected: SequenceNumber,
found: SequenceNumber,
},
BadSchemaVersion {
version: u32,
max: u32,
},
ExpectedRunStarted {
found: &'static str,
},
DuplicateRunStarted,
AfterTerminal {
terminal: &'static str,
},
ExpectedCompletion {
intent_seq: SequenceNumber,
found: &'static str,
},
MiscorrelatedCompletion {
expected: SequenceNumber,
found: SequenceNumber,
},
UncorrelatedCompletion {
found: &'static str,
},
IntentSeqMismatch {
envelope_seq: SequenceNumber,
inner_seq: SequenceNumber,
},
}Expand description
Why a candidate envelope is not the legal next event for a log.
One variant per illegal class, each naming the position or values that made
the decision, so the server can turn it into a precise 409 body.
Variants§
RunIdMismatch
The candidate names a different run than the log it would join.
NonContiguousSeq
The candidate’s sequence number is not the next contiguous position.
Fields
expected: SequenceNumberThe only position an append may occupy: one past the log’s end.
found: SequenceNumberThe position the candidate claimed.
BadSchemaVersion
The candidate’s schema version is outside the range this build writes.
Fields
max: u32The highest version this build understands (SCHEMA_VERSION).
ExpectedRunStarted
A fresh log must open with RunStarted; this candidate did not.
DuplicateRunStarted
A run head (RunStarted or GraphRunStarted) may appear only as the
first event; the log already has one.
AfterTerminal
The log already ended with a terminal event; nothing may follow it.
ExpectedCompletion
A dangling intent must be followed by its correlated completion, and the candidate is not it (a second intent, a context event, or the wrong completion kind).
Fields
intent_seq: SequenceNumberThe position of the pending intent awaiting completion.
The candidate is a completion of the right kind, but its correlation sequence does not match the pending intent it would complete.
The candidate is a completion, but no intent is pending for it to correlate to.
IntentSeqMismatch
A fresh intent’s own correlation sequence must equal its envelope position, and this one’s does not.
Fields
envelope_seq: SequenceNumberThe position the envelope occupies.
inner_seq: SequenceNumberThe correlation sequence the payload carried.
Trait Implementations§
Source§impl Clone for ValidationError
impl Clone for ValidationError
Source§fn clone(&self) -> ValidationError
fn clone(&self) -> ValidationError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ValidationError
impl Debug for ValidationError
Source§impl Display for ValidationError
impl Display for ValidationError
impl Eq for ValidationError
Source§impl Error for ValidationError
impl Error for ValidationError
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()