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>

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>

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>

Move the cursor to the next key.

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

Get the current entry.

Implementations on Foreign Types§

§

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

§

impl<C> TrieCursor for DatabaseAccountTrieCursor<C>

§

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>

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>

Move the cursor to the next entry and return it.

§

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

Retrieves the current key in the cursor.

§

impl<C> TrieCursor for DatabaseStorageTrieCursor<C>

§

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>

Seeks the given key in the storage trie.

§

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

Move the cursor to the next entry and return it.

§

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

Retrieves the current value in the storage trie cursor.

§

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

Implementors§