cuprate_txpool/service/
types.rs

1//! Database service type aliases.
2//!
3//! Only used internally for our [`tower::Service`] impls.
4
5use cuprate_database::DbResult;
6use cuprate_database_service::{DatabaseReadService, DatabaseWriteHandle};
7
8use crate::service::interface::{
9    TxpoolReadRequest, TxpoolReadResponse, TxpoolWriteRequest, TxpoolWriteResponse,
10};
11
12/// The actual type of the response.
13///
14/// Either our [`TxpoolReadResponse`], or a database error occurred.
15pub(super) type ReadResponseResult = DbResult<TxpoolReadResponse>;
16
17/// The transaction pool database write service.
18pub type TxpoolWriteHandle = DatabaseWriteHandle<TxpoolWriteRequest, TxpoolWriteResponse>;
19
20/// The transaction pool database read service.
21pub type TxpoolReadHandle = DatabaseReadService<TxpoolReadRequest, TxpoolReadResponse>;