Struct stateright::semantics::register::Register
source · pub struct Register<T>(pub T);
Expand description
A simple register used to define reference operational semantics via
SequentialSpec
.
Tuple Fields§
§0: T
Trait Implementations§
source§impl<T: PartialEq> PartialEq<Register<T>> for Register<T>
impl<T: PartialEq> PartialEq<Register<T>> for Register<T>
source§impl<T: Clone + Debug + PartialEq> SequentialSpec for Register<T>
impl<T: Clone + Debug + PartialEq> SequentialSpec for Register<T>
§type Op = RegisterOp<T>
type Op = RegisterOp<T>
The type of operators. Often an enum.
§type Ret = RegisterRet<T>
type Ret = RegisterRet<T>
The type of values return by the operators. Often an enum or
Option
.source§fn invoke(&mut self, op: &Self::Op) -> Self::Ret
fn invoke(&mut self, op: &Self::Op) -> Self::Ret
Invokes an operation on this reference object.
source§fn is_valid_step(&mut self, op: &Self::Op, ret: &Self::Ret) -> bool
fn is_valid_step(&mut self, op: &Self::Op, ret: &Self::Ret) -> bool
Indicates whether invoking a specified operation might result
in a specified return value. Includes a default implementation that
calls
invoke
, but a manual implementation may be provided for
efficiency purposes (e.g. to avoid a clone()
call).source§fn is_valid_history(
&mut self,
ops: impl IntoIterator<Item = (Self::Op, Self::Ret)>
) -> bool
fn is_valid_history( &mut self, ops: impl IntoIterator<Item = (Self::Op, Self::Ret)> ) -> bool
Indicates whether a sequential history of operations and corresponding
return values is valid for this reference object.
impl<T> StructuralPartialEq for Register<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for Register<T>where T: RefUnwindSafe,
impl<T> Send for Register<T>where T: Send,
impl<T> Sync for Register<T>where T: Sync,
impl<T> Unpin for Register<T>where T: Unpin,
impl<T> UnwindSafe for Register<T>where T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more