Skip to main content

NodeReader

Trait NodeReader 

Source
pub trait NodeReader {
    type Error;

    // Required methods
    fn get_node(
        &self,
        alg_id: u64,
        left: u64,
        height: u32,
    ) -> impl Future<Output = ReadResult<Option<Vec<u8>>, Self>> + Send;
    fn get_leaf(
        &self,
        index: u64,
    ) -> impl Future<Output = ReadResult<Vec<u8>, Self>> + Send;
}
Expand description

A borrowed read substrate the single-algorithm engine folds over.

The engine reads stored node digests and (for flat logs) raw leaf payloads through this trait; it never writes and never owns the store. The polydigest combinator implements it over its one shared storage so N algorithm views share a single data substrate (D14). The alg_id selects which algorithm’s node namespace the read targets — leaf payloads are algorithm-agnostic and stored once.

Required Associated Types§

Source

type Error

The read backend’s error type.

Required Methods§

Source

fn get_node( &self, alg_id: u64, left: u64, height: u32, ) -> impl Future<Output = ReadResult<Option<Vec<u8>>, Self>> + Send

Retrieve a sealed internal node digest at (alg_id, left, height), or None if no node is stored there.

Source

fn get_leaf( &self, index: u64, ) -> impl Future<Output = ReadResult<Vec<u8>, Self>> + Send

Retrieve the raw leaf payload at index (flat logs only).

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§