pub trait TrieCursor: Send + Sync {
// Required methods
fn seek_exact(
&mut self,
key: Nibbles,
) -> Result<Option<(Nibbles, BranchNodeCompact)>, DatabaseError>;
fn seek(
&mut self,
key: Nibbles,
) -> Result<Option<(Nibbles, BranchNodeCompact)>, DatabaseError>;
fn next(
&mut self,
) -> Result<Option<(Nibbles, BranchNodeCompact)>, DatabaseError>;
fn current(&mut self) -> Result<Option<Nibbles>, DatabaseError>;
}
Available on crate feature
trie
only.Expand description
A cursor for navigating a trie that works with both Tables and DupSort tables.
Required Methods§
Sourcefn seek_exact(
&mut self,
key: Nibbles,
) -> Result<Option<(Nibbles, BranchNodeCompact)>, DatabaseError>
fn seek_exact( &mut self, key: Nibbles, ) -> Result<Option<(Nibbles, BranchNodeCompact)>, DatabaseError>
Move the cursor to the key and return if it is an exact match.
Sourcefn seek(
&mut self,
key: Nibbles,
) -> Result<Option<(Nibbles, BranchNodeCompact)>, DatabaseError>
fn seek( &mut self, key: Nibbles, ) -> Result<Option<(Nibbles, BranchNodeCompact)>, DatabaseError>
Move the cursor to the key and return a value matching of greater than the key.
Sourcefn next(
&mut self,
) -> Result<Option<(Nibbles, BranchNodeCompact)>, DatabaseError>
fn next( &mut self, ) -> Result<Option<(Nibbles, BranchNodeCompact)>, DatabaseError>
Move the cursor to the next key.
Implementations on Foreign Types§
Source§impl<'a, T> TrieCursor for &'a mut T
impl<'a, T> TrieCursor for &'a mut T
fn seek_exact( &mut self, key: Nibbles, ) -> Result<Option<(Nibbles, BranchNodeCompact)>, DatabaseError>
fn seek( &mut self, key: Nibbles, ) -> Result<Option<(Nibbles, BranchNodeCompact)>, DatabaseError>
fn next( &mut self, ) -> Result<Option<(Nibbles, BranchNodeCompact)>, DatabaseError>
fn current(&mut self) -> Result<Option<Nibbles>, DatabaseError>
Source§impl<C> TrieCursor for DatabaseAccountTrieCursor<C>
impl<C> TrieCursor for DatabaseAccountTrieCursor<C>
Source§fn seek_exact(
&mut self,
key: Nibbles,
) -> Result<Option<(Nibbles, BranchNodeCompact)>, DatabaseError>
fn seek_exact( &mut self, key: Nibbles, ) -> Result<Option<(Nibbles, BranchNodeCompact)>, DatabaseError>
Seeks an exact match for the provided key in the account trie.
Source§fn seek(
&mut self,
key: Nibbles,
) -> Result<Option<(Nibbles, BranchNodeCompact)>, DatabaseError>
fn seek( &mut self, key: Nibbles, ) -> Result<Option<(Nibbles, BranchNodeCompact)>, DatabaseError>
Seeks a key in the account trie that matches or is greater than the provided key.
Source§fn next(
&mut self,
) -> Result<Option<(Nibbles, BranchNodeCompact)>, DatabaseError>
fn next( &mut self, ) -> Result<Option<(Nibbles, BranchNodeCompact)>, DatabaseError>
Move the cursor to the next entry and return it.
Source§impl<C> TrieCursor for DatabaseStorageTrieCursor<C>
impl<C> TrieCursor for DatabaseStorageTrieCursor<C>
Source§fn seek_exact(
&mut self,
key: Nibbles,
) -> Result<Option<(Nibbles, BranchNodeCompact)>, DatabaseError>
fn seek_exact( &mut self, key: Nibbles, ) -> Result<Option<(Nibbles, BranchNodeCompact)>, DatabaseError>
Seeks an exact match for the given key in the storage trie.
Source§fn seek(
&mut self,
key: Nibbles,
) -> Result<Option<(Nibbles, BranchNodeCompact)>, DatabaseError>
fn seek( &mut self, key: Nibbles, ) -> Result<Option<(Nibbles, BranchNodeCompact)>, DatabaseError>
Seeks the given key in the storage trie.
Source§fn next(
&mut self,
) -> Result<Option<(Nibbles, BranchNodeCompact)>, DatabaseError>
fn next( &mut self, ) -> Result<Option<(Nibbles, BranchNodeCompact)>, DatabaseError>
Move the cursor to the next entry and return it.