Trait grovedb_merk::tree::Fetch

source ·
pub trait Fetch {
    // Required method
    fn fetch(
        &self,
        link: &Link,
        value_defined_cost_fn: Option<&impl Fn(&[u8], &GroveVersion) -> Option<ValueDefinedCostType>>,
        grove_version: &GroveVersion,
    ) -> CostResult<TreeNode, Error>;
}
Expand description

A source of data to be used by the tree when encountering a pruned node. This typically means fetching the tree node from a backing store by its key, but could also implement an in-memory cache for example.

Required Methods§

source

fn fetch( &self, link: &Link, value_defined_cost_fn: Option<&impl Fn(&[u8], &GroveVersion) -> Option<ValueDefinedCostType>>, grove_version: &GroveVersion, ) -> CostResult<TreeNode, Error>

Called when the tree needs to fetch a node with the given Link. The link value will always be a Link::Reference variant.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Fetch for PanicSource

source§

impl<'s, 'db, S> Fetch for MerkSource<'s, S>
where S: StorageContext<'db>,