pub struct ConformanceOracle<V, C>where
V: Identities,{ /* private fields */ }Expand description
The contract’s rules over one instance’s event stream. C is the consumer’s context type;
the oracle keeps the context each push was given, to compare with its completion’s.
Implementations§
Source§impl<V, C> ConformanceOracle<V, C>where
V: Identities,
C: PartialEq,
impl<V, C> ConformanceOracle<V, C>where
V: Identities,
C: PartialEq,
Sourcepub fn new() -> ConformanceOracle<V, C>
pub fn new() -> ConformanceOracle<V, C>
An oracle that has seen nothing.
Sourcepub fn healed(&mut self, failure: <V as Identities>::FailureId)
pub fn healed(&mut self, failure: <V as Identities>::FailureId)
Report a failure the consumer healed: resolve accepted Heal for it. Abandoning needs no
report; the Abandoned entry is the record.
Sourcepub fn sealed(&mut self, through: Epoch<V>)
pub fn sealed(&mut self, through: Epoch<V>)
Report a seal the instance accepted as new: make_durable_through(through) answered
Submitted. A request answered AlreadySealed changes nothing and need not be reported.
Sourcepub fn pushed(
&mut self,
op: <V as Identities>::OpId,
kind: OpKind<V>,
length: u32,
context: C,
) -> Result<(), Violation<V>>
pub fn pushed( &mut self, op: <V as Identities>::OpId, kind: OpKind<V>, length: u32, context: C, ) -> Result<(), Violation<V>>
Report an accepted push: the identity it returned, what it was, the bytes it asked to transfer – a write’s whole length, a read’s buffer – and the context it was given (a copy; the instance has the original).
§Errors
Violation::DuplicateIdentity if an earlier push returned op,
Violation::WriteToEndedLineage for a write into a lineage reported ended,
Violation::WriteAfterSeal for a write at or below its lineage’s seal, and
Violation::WriteToAbandoned for a write into an epoch reported abandoned.
Sourcepub fn pushed_gated(
&mut self,
op: <V as Identities>::OpId,
kind: OpKind<V>,
length: u32,
context: C,
gate: Epoch<V>,
) -> Result<(), Violation<V>>
pub fn pushed_gated( &mut self, op: <V as Identities>::OpId, kind: OpKind<V>, length: u32, context: C, gate: Epoch<V>, ) -> Result<(), Violation<V>>
Report an accepted push gated on gate, as Self::pushed reports one without.
§Errors
As Self::pushed.
Sourcepub fn outstanding(&self) -> usize
pub fn outstanding(&self) -> usize
How many pushed operations have not completed.