Struct sov_state::WorkingSet
source · pub struct WorkingSet<S: Storage> { /* private fields */ }
Expand description
This structure contains the read-write set and the events collected during the execution of a transaction. There are two ways to convert it into a StateCheckpoint:
- By using the checkpoint() method, where all the changes are added to the underlying StateCheckpoint.
- By using the revert method, where the most recent changes are reverted and the previous
StateCheckpoint
is returned.
Implementations§
source§impl<S: Storage> WorkingSet<S>
impl<S: Storage> WorkingSet<S>
pub fn new(inner: S) -> Self
pub fn accessory_state(&mut self) -> AccessoryWorkingSet<'_, S>
pub fn with_witness(inner: S, witness: S::Witness) -> Self
pub fn checkpoint(self) -> StateCheckpoint<S>
pub fn revert(self) -> StateCheckpoint<S>
pub fn add_event(&mut self, key: &str, value: &str)
pub fn take_events(&mut self) -> Vec<Event>
pub fn events(&self) -> &[Event]
pub fn backing(&self) -> &S
Auto Trait Implementations§
impl<S> RefUnwindSafe for WorkingSet<S>where S: RefUnwindSafe, <S as Storage>::Witness: RefUnwindSafe,
impl<S> Send for WorkingSet<S>where S: Send, <S as Storage>::Witness: Send,
impl<S> Sync for WorkingSet<S>where S: Sync, <S as Storage>::Witness: Sync,
impl<S> Unpin for WorkingSet<S>where S: Unpin, <S as Storage>::Witness: Unpin,
impl<S> UnwindSafe for WorkingSet<S>where S: UnwindSafe, <S as Storage>::Witness: 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