reth_trie::trie_cursor

Trait TrieCursor

Source
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§

Source

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.

Source

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.

Source

fn next( &mut self, ) -> Result<Option<(Nibbles, BranchNodeCompact)>, DatabaseError>

Move the cursor to the next key.

Source

fn current(&mut self) -> Result<Option<Nibbles>, DatabaseError>

Get the current entry.

Implementations on Foreign Types§

Source§

impl<'a, T: 'a + TrieCursor + ?Sized> TrieCursor for &'a mut T
where &'a mut T: Send + Sync,

Source§

fn seek_exact( &mut self, key: Nibbles, ) -> Result<Option<(Nibbles, BranchNodeCompact)>, DatabaseError>

Source§

fn seek( &mut self, key: Nibbles, ) -> Result<Option<(Nibbles, BranchNodeCompact)>, DatabaseError>

Source§

fn next( &mut self, ) -> Result<Option<(Nibbles, BranchNodeCompact)>, DatabaseError>

Source§

fn current(&mut self) -> Result<Option<Nibbles>, DatabaseError>

Source§

impl<T: TrieCursor + ?Sized> TrieCursor for Box<T>
where Box<T>: Send + Sync,

Source§

fn seek_exact( &mut self, key: Nibbles, ) -> Result<Option<(Nibbles, BranchNodeCompact)>, DatabaseError>

Source§

fn seek( &mut self, key: Nibbles, ) -> Result<Option<(Nibbles, BranchNodeCompact)>, DatabaseError>

Source§

fn next( &mut self, ) -> Result<Option<(Nibbles, BranchNodeCompact)>, DatabaseError>

Source§

fn current(&mut self) -> Result<Option<Nibbles>, DatabaseError>

Implementors§