Struct cfx_storage::SubTrieVisitor
source · pub struct SubTrieVisitor<'trie, 'db: 'trie> { /* private fields */ }
Implementations§
source§impl<'trie> SubTrieVisitor<'trie, 'trie>
impl<'trie> SubTrieVisitor<'trie, 'trie>
pub fn new( trie_ref: &'trie DeltaMpt, root: NodeRefDeltaMpt, owned_node_set: &'trie mut Option<OwnedNodeSet> ) -> Result<Self>
source§impl<'trie, 'db: 'trie> SubTrieVisitor<'trie, 'db>
impl<'trie, 'db: 'trie> SubTrieVisitor<'trie, 'db>
pub fn get_trie_ref(&self) -> &'trie DeltaMpt
pub fn get_proof<'a>(&mut self, key: &'_ [u8]) -> Result<TrieProof>
pub fn get(&mut self, key: &'_ [u8]) -> Result<MptValue<Box<[u8]>>>
pub fn get_merkle_hash_wo_compressed_path( &mut self, key: &'_ [u8] ) -> Result<Option<MerkleHash>>
sourcepub fn delete(
self,
key: &'_ [u8]
) -> Result<(Option<Box<[u8]>>, bool, Option<NodeRefDeltaMptCompact>)>
pub fn delete( self, key: &'_ [u8] ) -> Result<(Option<Box<[u8]>>, bool, Option<NodeRefDeltaMptCompact>)>
The visitor can only be used once to modify. Returns (deleted value, is root node replaced, the current root node for the subtree).
sourcepub fn delete_all(
self,
key: &'_ [u8],
key_remaining: &'_ [u8]
) -> Result<(Option<Vec<MptKeyValue>>, bool, Option<NodeRefDeltaMptCompact>)>
pub fn delete_all( self, key: &'_ [u8], key_remaining: &'_ [u8] ) -> Result<(Option<Vec<MptKeyValue>>, bool, Option<NodeRefDeltaMptCompact>)>
The visitor can only be used once to modify. Returns (deleted value, is root node replaced, the current root node for the subtree).
sourcepub fn traversal(
self,
key: &'_ [u8],
key_remaining: &'_ [u8]
) -> Result<Option<Vec<MptKeyValue>>>
pub fn traversal( self, key: &'_ [u8], key_remaining: &'_ [u8] ) -> Result<Option<Vec<MptKeyValue>>>
return all key/value pairs given the prefix
pub fn set(self, key: &'_ [u8], value: Box<[u8]>) -> Result<NodeRefDeltaMpt>
Auto Trait Implementations§
impl<'trie, 'db> !RefUnwindSafe for SubTrieVisitor<'trie, 'db>
impl<'trie, 'db> Send for SubTrieVisitor<'trie, 'db>
impl<'trie, 'db> Sync for SubTrieVisitor<'trie, 'db>
impl<'trie, 'db> Unpin for SubTrieVisitor<'trie, 'db>
impl<'trie, 'db> !UnwindSafe for SubTrieVisitor<'trie, 'db>
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