reth_db_api/
common.rs

1use crate::{table::*, DatabaseError};
2
3/// A key-value pair for table `T`.
4pub type KeyValue<T> = (<T as Table>::Key, <T as Table>::Value);
5
6/// A fallible key-value pair that may or may not exist.
7///
8/// The `Result` represents that the operation might fail, while the `Option` represents whether or
9/// not the entry exists.
10pub type PairResult<T> = Result<Option<KeyValue<T>>, DatabaseError>;
11
12/// A key-value pair coming from an iterator.
13///
14/// The `Result` represents that the operation might fail, while the `Option` represents whether or
15/// not there is another entry.
16pub type IterPairResult<T> = Option<Result<KeyValue<T>, DatabaseError>>;
17
18/// A value only result for table `T`.
19pub type ValueOnlyResult<T> = Result<Option<<T as Table>::Value>, DatabaseError>;