Skip to main content

TrieCursorFactory

Trait TrieCursorFactory 

Source
pub trait TrieCursorFactory {
    type AccountTrieCursor<'a>: TrieCursor
       where Self: 'a;
    type StorageTrieCursor<'a>: TrieStorageCursor
       where Self: 'a;

    // Required methods
    fn account_trie_cursor(
        &self,
    ) -> Result<Self::AccountTrieCursor<'_>, DatabaseError>;
    fn storage_trie_cursor(
        &self,
        hashed_address: B256,
    ) -> Result<Self::StorageTrieCursor<'_>, DatabaseError>;
}
Expand description

Factory for creating trie cursors.

Required Associated Types§

Source

type AccountTrieCursor<'a>: TrieCursor where Self: 'a

The account trie cursor type.

Source

type StorageTrieCursor<'a>: TrieStorageCursor where Self: 'a

The storage trie cursor type.

Required Methods§

Source

fn account_trie_cursor( &self, ) -> Result<Self::AccountTrieCursor<'_>, DatabaseError>

Create an account trie cursor.

Source

fn storage_trie_cursor( &self, hashed_address: B256, ) -> Result<Self::StorageTrieCursor<'_>, DatabaseError>

Create a storage tries cursor.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<'b, T: 'b + TrieCursorFactory + ?Sized> TrieCursorFactory for &'b T

Source§

type AccountTrieCursor<'a> = <T as TrieCursorFactory>::AccountTrieCursor<'a> where Self: 'a

Source§

type StorageTrieCursor<'a> = <T as TrieCursorFactory>::StorageTrieCursor<'a> where Self: 'a

Source§

fn account_trie_cursor( &self, ) -> Result<Self::AccountTrieCursor<'_>, DatabaseError>

Source§

fn storage_trie_cursor( &self, hashed_address: B256, ) -> Result<Self::StorageTrieCursor<'_>, DatabaseError>

Implementors§

Source§

impl TrieCursorFactory for MockTrieCursorFactory

Available on crate features test-utils only.
Source§

type AccountTrieCursor<'a> = MockTrieCursor where Self: 'a

Source§

type StorageTrieCursor<'a> = MockTrieCursor where Self: 'a

Source§

impl TrieCursorFactory for NoopTrieCursorFactory

Source§

impl<'overlay, CF, T> TrieCursorFactory for InMemoryTrieCursorFactory<CF, &'overlay T>
where CF: TrieCursorFactory + 'overlay, T: AsRef<TrieUpdatesSorted>,

Source§

type AccountTrieCursor<'cursor> = InMemoryTrieCursor<'overlay, <CF as TrieCursorFactory>::AccountTrieCursor<'cursor>> where Self: 'cursor

Source§

type StorageTrieCursor<'cursor> = InMemoryTrieCursor<'overlay, <CF as TrieCursorFactory>::StorageTrieCursor<'cursor>> where Self: 'cursor