Struct cfx_storage::RecordingStorage
source · pub struct RecordingStorage<Storage: StateTrait> { /* private fields */ }
Implementations§
source§impl<Storage: StateTrait> RecordingStorage<Storage>
impl<Storage: StateTrait> RecordingStorage<Storage>
pub fn new(storage: Storage) -> Self
pub fn try_into_proof(self) -> Result<StateProof>
Trait Implementations§
source§impl<Storage: StateTrait + StateTraitExt> StateTrait for RecordingStorage<Storage>
impl<Storage: StateTrait + StateTraitExt> StateTrait for RecordingStorage<Storage>
fn set( &mut self, access_key: StorageKeyWithSpace<'_>, value: Box<[u8]> ) -> Result<()>
fn delete(&mut self, access_key: StorageKeyWithSpace<'_>) -> Result<()>
fn delete_test_only( &mut self, access_key: StorageKeyWithSpace<'_> ) -> Result<Option<Box<[u8]>>>
source§fn compute_state_root(&mut self) -> Result<StateRootWithAuxInfo>
fn compute_state_root(&mut self) -> Result<StateRootWithAuxInfo>
It’s costly to compute state root however it’s only necessary to compute
state root once before committing.
fn get_state_root(&self) -> Result<StateRootWithAuxInfo>
fn commit(&mut self, epoch_id: EpochId) -> Result<StateRootWithAuxInfo>
fn get(&self, access_key: StorageKeyWithSpace<'_>) -> Result<Option<Box<[u8]>>>
fn delete_all( &mut self, access_key_prefix: StorageKeyWithSpace<'_> ) -> Result<Option<Vec<MptKeyValue>>>
fn read_all( &mut self, access_key_prefix: StorageKeyWithSpace<'_> ) -> Result<Option<Vec<MptKeyValue>>>
Auto Trait Implementations§
impl<Storage> !RefUnwindSafe for RecordingStorage<Storage>
impl<Storage> Send for RecordingStorage<Storage>
impl<Storage> Sync for RecordingStorage<Storage>
impl<Storage> Unpin for RecordingStorage<Storage>where
Storage: Unpin,
impl<Storage> UnwindSafe for RecordingStorage<Storage>where
Storage: 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