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 traversing stored trie nodes. The cursor must iterate over keys in lexicographical order.
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.