pub enum MetadataIoCommitObservation {
Settled {
generation: MetadataGeneration,
outcome: MetadataIoCommitOutcome,
},
Unobserved {
generation: MetadataGeneration,
},
TargetConflict(MetadataWriteRequest),
}Expand description
What a caller actually confirmed about one admitted metadata snapshot.
Unlike MetadataIoCommitOutcome, this models the case where the caller
stopped observing before the persistence protocol reached a terminal
conclusion. An unobserved generation is not evidence that the write did not
happen: the admitted snapshot keeps its ordering and byte charge, so it may
still become durable, fail, or end unconfirmed after the caller’s deadline.
Business owners must treat that generation as unconfirmed rather than as a
definite failure.
Every conclusion except a target conflict carries the observed generation,
so a caller can record the change identity and later resolve it against
MetadataIoActor::confirmed_durable_generation.
Variants§
Settled
The persistence protocol reached a terminal conclusion within the caller’s deadline.
Fields
generation: MetadataGenerationThe generation the caller observed.
outcome: MetadataIoCommitOutcomeThe conclusion the actor delivered.
Unobserved
The caller stopped observing first. The generation identifies the change whose durability was not confirmed.
Fields
generation: MetadataGenerationThe generation whose durability was not confirmed.
TargetConflict(MetadataWriteRequest)
The request was not admitted because the resource is bound to a different process-local target.
Implementations§
Source§impl MetadataIoCommitObservation
impl MetadataIoCommitObservation
Sourcepub fn requires_reconciliation(&self) -> bool
pub fn requires_reconciliation(&self) -> bool
Returns whether the caller must treat durable state as unconfirmed.
True for an unobserved generation and for a replacement that the durability protocol did not confirm. False for a confirmed durable write, a failure before target replacement, and a target conflict.
Sourcepub fn settled(self) -> Option<MetadataIoCommitOutcome>
pub fn settled(self) -> Option<MetadataIoCommitOutcome>
Consumes the observation and returns the terminal conclusion, if any.
Sourcepub const fn generation(&self) -> Option<MetadataGeneration>
pub const fn generation(&self) -> Option<MetadataGeneration>
Returns the observed generation, or None for a target conflict.
Sourcepub const fn unobserved_generation(&self) -> Option<MetadataGeneration>
pub const fn unobserved_generation(&self) -> Option<MetadataGeneration>
Returns the generation whose durability was not confirmed.