Trait TrieCursor
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§
fn 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.
fn 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.
fn next(
&mut self,
) -> Result<Option<(Nibbles, BranchNodeCompact)>, DatabaseError>
fn next( &mut self, ) -> Result<Option<(Nibbles, BranchNodeCompact)>, DatabaseError>
Move the cursor to the next key.
fn current(&mut self) -> Result<Option<Nibbles>, DatabaseError>
fn current(&mut self) -> Result<Option<Nibbles>, DatabaseError>
Get the current entry.
Implementations on Foreign Types§
§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>
§impl<C> TrieCursor for DatabaseAccountTrieCursor<C>
impl<C> TrieCursor for DatabaseAccountTrieCursor<C>
§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.
§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.
§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.
§impl<C> TrieCursor for DatabaseStorageTrieCursor<C>
impl<C> TrieCursor for DatabaseStorageTrieCursor<C>
§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.
§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.
§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.