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§
sourcefn zs_is_empty<C>(&self, cf: &C) -> boolwhere
C: AsColumnFamilyRef,
fn zs_is_empty<C>(&self, cf: &C) -> boolwhere
C: AsColumnFamilyRef,
Returns true if a rocksdb column family cf
does not contain any entries.
sourcefn zs_get<C, K, V>(&self, cf: &C, key: &K) -> Option<V>
fn zs_get<C, K, V>(&self, cf: &C, key: &K) -> Option<V>
Returns the value for key
in the rocksdb column family cf
, if present.
sourcefn zs_contains<C, K>(&self, cf: &C, key: &K) -> boolwhere
C: AsColumnFamilyRef,
K: IntoDisk,
fn zs_contains<C, K>(&self, cf: &C, key: &K) -> boolwhere
C: AsColumnFamilyRef,
K: IntoDisk,
Check if a rocksdb column family cf
contains the serialized form of key
.
sourcefn zs_first_key_value<C, K, V>(&self, cf: &C) -> Option<(K, V)>
fn zs_first_key_value<C, K, V>(&self, cf: &C) -> Option<(K, V)>
Returns the lowest key in cf
, and the corresponding value.
Returns None
if the column family is empty.
sourcefn zs_last_key_value<C, K, V>(&self, cf: &C) -> Option<(K, V)>
fn zs_last_key_value<C, K, V>(&self, cf: &C) -> Option<(K, V)>
Returns the highest key in cf
, and the corresponding value.
Returns None
if the column family is empty.
sourcefn zs_next_key_value_from<C, K, V>(
&self,
cf: &C,
lower_bound: &K,
) -> Option<(K, V)>
fn zs_next_key_value_from<C, K, V>( &self, cf: &C, lower_bound: &K, ) -> Option<(K, V)>
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
.
sourcefn zs_next_key_value_strictly_after<C, K, V>(
&self,
cf: &C,
lower_bound: &K,
) -> Option<(K, V)>
fn zs_next_key_value_strictly_after<C, K, V>( &self, cf: &C, lower_bound: &K, ) -> Option<(K, V)>
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
.
sourcefn zs_prev_key_value_back_from<C, K, V>(
&self,
cf: &C,
upper_bound: &K,
) -> Option<(K, V)>
fn zs_prev_key_value_back_from<C, K, V>( &self, cf: &C, upper_bound: &K, ) -> Option<(K, V)>
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
.
sourcefn zs_prev_key_value_strictly_before<C, K, V>(
&self,
cf: &C,
upper_bound: &K,
) -> Option<(K, V)>
fn zs_prev_key_value_strictly_before<C, K, V>( &self, cf: &C, upper_bound: &K, ) -> Option<(K, V)>
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
.
sourcefn zs_items_in_range_ordered<C, K, V, R>(
&self,
cf: &C,
range: R,
) -> BTreeMap<K, V>
fn zs_items_in_range_ordered<C, K, V, R>( &self, cf: &C, range: R, ) -> BTreeMap<K, V>
Returns the keys and values in cf
in range
, in an ordered BTreeMap
.
Holding this iterator open might delay block commit transactions.
sourcefn zs_items_in_range_unordered<C, K, V, R>(
&self,
cf: &C,
range: R,
) -> HashMap<K, V>
fn zs_items_in_range_unordered<C, K, V, R>( &self, cf: &C, range: R, ) -> HashMap<K, V>
Returns the keys and values in cf
in range
, in an unordered HashMap
.
Holding this iterator open might delay block commit transactions.