Trait zebra_state::service::finalized_state::disk_db::ReadDisk

source ·
pub trait ReadDisk {
    // Required methods
    fn zs_is_empty<C>(&self, cf: &C) -> bool
       where C: AsColumnFamilyRef;
    fn zs_get<C, K, V>(&self, cf: &C, key: &K) -> Option<V>
       where C: AsColumnFamilyRef,
             K: IntoDisk,
             V: FromDisk;
    fn zs_contains<C, K>(&self, cf: &C, key: &K) -> bool
       where C: AsColumnFamilyRef,
             K: IntoDisk;
    fn zs_first_key_value<C, K, V>(&self, cf: &C) -> Option<(K, V)>
       where C: AsColumnFamilyRef,
             K: IntoDisk + FromDisk,
             V: FromDisk;
    fn zs_last_key_value<C, K, V>(&self, cf: &C) -> Option<(K, V)>
       where C: AsColumnFamilyRef,
             K: IntoDisk + FromDisk,
             V: FromDisk;
    fn zs_next_key_value_from<C, K, V>(
        &self,
        cf: &C,
        lower_bound: &K,
    ) -> Option<(K, V)>
       where C: AsColumnFamilyRef,
             K: IntoDisk + FromDisk,
             V: FromDisk;
    fn zs_next_key_value_strictly_after<C, K, V>(
        &self,
        cf: &C,
        lower_bound: &K,
    ) -> Option<(K, V)>
       where C: AsColumnFamilyRef,
             K: IntoDisk + FromDisk,
             V: FromDisk;
    fn zs_prev_key_value_back_from<C, K, V>(
        &self,
        cf: &C,
        upper_bound: &K,
    ) -> Option<(K, V)>
       where C: AsColumnFamilyRef,
             K: IntoDisk + FromDisk,
             V: FromDisk;
    fn zs_prev_key_value_strictly_before<C, K, V>(
        &self,
        cf: &C,
        upper_bound: &K,
    ) -> Option<(K, V)>
       where C: AsColumnFamilyRef,
             K: IntoDisk + FromDisk,
             V: FromDisk;
    fn zs_items_in_range_ordered<C, K, V, R>(
        &self,
        cf: &C,
        range: R,
    ) -> BTreeMap<K, V>
       where C: AsColumnFamilyRef,
             K: IntoDisk + FromDisk + Ord,
             V: FromDisk,
             R: RangeBounds<K>;
    fn zs_items_in_range_unordered<C, K, V, R>(
        &self,
        cf: &C,
        range: R,
    ) -> HashMap<K, V>
       where C: AsColumnFamilyRef,
             K: IntoDisk + FromDisk + Eq + Hash,
             V: FromDisk,
             R: RangeBounds<K>;
}
Expand description

Helper trait for retrieving and deserializing values from rocksdb column families.

§Deprecation

This trait should not be used in new code, use TypedColumnFamily instead.

Required Methods§

source

fn zs_is_empty<C>(&self, cf: &C) -> bool
where C: AsColumnFamilyRef,

Returns true if a rocksdb column family cf does not contain any entries.

source

fn zs_get<C, K, V>(&self, cf: &C, key: &K) -> Option<V>
where C: AsColumnFamilyRef, K: IntoDisk, V: FromDisk,

Returns the value for key in the rocksdb column family cf, if present.

source

fn zs_contains<C, K>(&self, cf: &C, key: &K) -> bool
where C: AsColumnFamilyRef, K: IntoDisk,

Check if a rocksdb column family cf contains the serialized form of key.

source

fn zs_first_key_value<C, K, V>(&self, cf: &C) -> Option<(K, V)>
where C: AsColumnFamilyRef, K: IntoDisk + FromDisk, V: FromDisk,

Returns the lowest key in cf, and the corresponding value.

Returns None if the column family is empty.

source

fn zs_last_key_value<C, K, V>(&self, cf: &C) -> Option<(K, V)>
where C: AsColumnFamilyRef, K: IntoDisk + FromDisk, V: FromDisk,

Returns the highest key in cf, and the corresponding value.

Returns None if the column family is empty.

source

fn zs_next_key_value_from<C, K, V>( &self, cf: &C, lower_bound: &K, ) -> Option<(K, V)>
where C: AsColumnFamilyRef, K: IntoDisk + FromDisk, V: FromDisk,

Returns the first key greater than or equal to lower_bound in cf, and the corresponding value.

Returns None if there are no keys greater than or equal to lower_bound.

source

fn zs_next_key_value_strictly_after<C, K, V>( &self, cf: &C, lower_bound: &K, ) -> Option<(K, V)>
where C: AsColumnFamilyRef, K: IntoDisk + FromDisk, V: FromDisk,

Returns the first key strictly greater than lower_bound in cf, and the corresponding value.

Returns None if there are no keys greater than lower_bound.

source

fn zs_prev_key_value_back_from<C, K, V>( &self, cf: &C, upper_bound: &K, ) -> Option<(K, V)>
where C: AsColumnFamilyRef, K: IntoDisk + FromDisk, V: FromDisk,

Returns the first key less than or equal to upper_bound in cf, and the corresponding value.

Returns None if there are no keys less than or equal to upper_bound.

source

fn zs_prev_key_value_strictly_before<C, K, V>( &self, cf: &C, upper_bound: &K, ) -> Option<(K, V)>
where C: AsColumnFamilyRef, K: IntoDisk + FromDisk, V: FromDisk,

Returns the first key strictly less than upper_bound in cf, and the corresponding value.

Returns None if there are no keys less than upper_bound.

source

fn zs_items_in_range_ordered<C, K, V, R>( &self, cf: &C, range: R, ) -> BTreeMap<K, V>
where C: AsColumnFamilyRef, K: IntoDisk + FromDisk + Ord, V: FromDisk, R: RangeBounds<K>,

Returns the keys and values in cf in range, in an ordered BTreeMap.

Holding this iterator open might delay block commit transactions.

source

fn zs_items_in_range_unordered<C, K, V, R>( &self, cf: &C, range: R, ) -> HashMap<K, V>
where C: AsColumnFamilyRef, K: IntoDisk + FromDisk + Eq + Hash, V: FromDisk, R: RangeBounds<K>,

Returns the keys and values in cf in range, in an unordered HashMap.

Holding this iterator open might delay block commit transactions.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl ReadDisk for DiskDb

§Deprecation

These impls should not be used in new code, use TypedColumnFamily instead.