This commit is contained in:
Julien Cretin
2021-10-01 17:49:42 +02:00
committed by Julien Cretin
parent 67fa8bee0b
commit daa16d948f
2 changed files with 91 additions and 7 deletions

View File

@@ -453,6 +453,12 @@ impl StoreDriverOn {
self.apply(StoreOperation::Transaction { updates })
}
/// Applies a clear operation to the store and model without interruption.
#[cfg(feature = "std")]
pub fn clear(&mut self, min_key: usize) -> Result<(), StoreInvariant> {
self.apply(StoreOperation::Clear { min_key })
}
/// Checks that the store and model are in sync.
pub fn check(&self) -> Result<(), StoreInvariant> {
self.recover_check(&[])
@@ -610,4 +616,12 @@ impl<'a> StoreInterruption<'a> {
corrupt: Box::new(|_, _| {}),
}
}
/// Builds an interruption without corruption.
pub fn pure(delay: usize) -> StoreInterruption<'a> {
StoreInterruption {
delay,
corrupt: Box::new(|_, _| {}),
}
}
}