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>;
}
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.