pub struct InvariantRecordSlot {
pub current: InvariantStateRecord,
pub previous: Vec<InvariantStateRecord>,
}Expand description
The single-key slot holding one invariant’s CURRENT record plus its retention-bounded prior generations (oldest first).
One value per (loop, invariant) key keeps every mutation — rotation on a new current, pruning to the declared window — a single atomic value swap, which every backend (including the distributed CAS path) supports without multi-key transactions. Retention is what keeps the slot bounded: the declared window is mandatory, so unbounded growth is unrepresentable.
Fields§
§current: InvariantStateRecordThe current record — survives indefinitely, NEVER pruned (R8.1).
previous: Vec<InvariantStateRecord>Prior generations within the retention window, oldest first.
Implementations§
Source§impl InvariantRecordSlot
impl InvariantRecordSlot
Sourcepub fn encode(&self) -> Result<Vec<u8>, StoreError>
pub fn encode(&self) -> Result<Vec<u8>, StoreError>
Encode the stable backend-neutral representation.
§Errors
Returns StoreError::Serialization when serialization fails.
Sourcepub fn decode(bytes: &[u8]) -> Result<Self, StoreError>
pub fn decode(bytes: &[u8]) -> Result<Self, StoreError>
Sourcepub fn rotated(self, record: InvariantStateRecord) -> Self
pub fn rotated(self, record: InvariantStateRecord) -> Self
Rotate record in as the new current, pushing the old current onto the
generation list.
Trait Implementations§
Source§impl Clone for InvariantRecordSlot
impl Clone for InvariantRecordSlot
Source§fn clone(&self) -> InvariantRecordSlot
fn clone(&self) -> InvariantRecordSlot
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more