Trait reth_trie::trie_cursor::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§