#[non_exhaustive]pub struct ConditionViolated {
pub conflicting_position: Option<SequencePosition>,
}Expand description
The specification-defined outcome of an append that was rejected because the
store already held an event matching the
AppendCondition.
This is the DCB concurrency signal. Callers respond by rebuilding their decision model from the current state and retrying — it is an expected, routine outcome under contention, not a fault.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.conflicting_position: Option<SequencePosition>The position of a conflicting event, when the adapter can identify one cheaply.
A hint, not a promise, and a caller must be written for None. An
adapter that detects the conflict without learning which event caused it
reports None, and that is not a deficient adapter: a store reached over
one-shot HTTP has no interactive transaction, so the only shape it can
express is a conditional INSERT … SELECT … WHERE NOT EXISTS, which
yields a boolean and no row. A retry loop that branches on this field
being Some works against an in-process store and stops working against
a remote one.
Implementations§
Source§impl ConditionViolated
impl ConditionViolated
Sourcepub const fn unspecified() -> Self
pub const fn unspecified() -> Self
A violation with no identified conflicting event.
Sourcepub const fn at(position: SequencePosition) -> Self
pub const fn at(position: SequencePosition) -> Self
A violation naming the event that caused it.
Trait Implementations§
Source§impl Clone for ConditionViolated
impl Clone for ConditionViolated
Source§impl Debug for ConditionViolated
impl Debug for ConditionViolated
Source§impl Display for ConditionViolated
impl Display for ConditionViolated
Source§fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Renders the conflicting position when the adapter supplied one.
Hand-written rather than a thiserror attribute because the message has
two shapes, and the field the store already populates was previously
carried and never shown — an operator reading a log got “the store
already contains a matching event” and no way to find which.
impl Eq for ConditionViolated
Source§impl Error for ConditionViolated
impl Error for ConditionViolated
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()