pub trait ConsistencyTester<T, RefObj>where
RefObj: SequentialSpec,
T: Copy,{
// Required methods
fn on_invoke(
&mut self,
thread_id: T,
op: RefObj::Op,
) -> Result<&mut Self, String>;
fn on_return(
&mut self,
thread_id: T,
ret: RefObj::Ret,
) -> Result<&mut Self, String>;
fn is_consistent(&self) -> bool;
// Provided method
fn on_invret(
&mut self,
thread_id: T,
op: RefObj::Op,
ret: RefObj::Ret,
) -> Result<&mut Self, String> { ... }
}Expand description
An implementation of this trait tests the consistency of a concurrent system with respect to
a “reference sequential specification” SequentialSpec. The interface for doing so involves
recording operation invocations and returns.
Currently the library includes implementations in the form of a LinearizabilityTester and
SequentialConsistencyTester.
Required Methods§
Sourcefn on_invoke(
&mut self,
thread_id: T,
op: RefObj::Op,
) -> Result<&mut Self, String>
fn on_invoke( &mut self, thread_id: T, op: RefObj::Op, ) -> Result<&mut Self, String>
Indicates that a thread invoked an operation. Returns Ok(...) if the
history is valid, even if it is not consistent.
Sourcefn on_return(
&mut self,
thread_id: T,
ret: RefObj::Ret,
) -> Result<&mut Self, String>
fn on_return( &mut self, thread_id: T, ret: RefObj::Ret, ) -> Result<&mut Self, String>
Indicates that a thread’s earlier operation invocation returned. Returns
Ok(...) if the history is valid, even if it is not consistent.
Sourcefn is_consistent(&self) -> bool
fn is_consistent(&self) -> bool
Indicates whether the recorded history is consistent with the semantics expected by the tester.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.