hopr_api/db/
mod.rs

1mod tickets;
2
3pub use tickets::*;
4
5/// Shorthand for the `chrono` based timestamp type used in the database.
6pub type DbTimestamp = chrono::DateTime<chrono::Utc>;
7
8/// Complete set of HOPR node database APIs.
9///
10/// This trait is automatically implemented for types
11/// that implement all the individual chain API traits to be implemented with the same error.
12pub trait HoprNodeDbApi: HoprDbTicketOperations<Error = Self::NodeDbError> {
13    type NodeDbError: std::error::Error + Send + Sync + 'static;
14}
15
16impl<T, E> HoprNodeDbApi for T
17where
18    T: HoprDbTicketOperations<Error = E>,
19    E: std::error::Error + Send + Sync + 'static,
20{
21    type NodeDbError = E;
22}