zebra_node_services/
service_traits.rs

1//! A trait alias for Zebra services based on `tower::Service`.
2
3use crate::BoxError;
4use tower::Service;
5
6/// A supertrait for Zebra services.
7///
8/// It adds common bounds like `Clone`, `Send`, and `Sync`,
9/// and uses `BoxError` as the default error type.
10pub trait ZebraService<Request, Response, Err = BoxError>:
11    Service<Request, Response = Response, Error = Err, Future: Send + 'static>
12    + Clone
13    + Send
14    + Sync
15    + 'static
16{
17}
18
19impl<T, Request, Response, Err> ZebraService<Request, Response, Err> for T where
20    T: Service<Request, Response = Response, Error = Err, Future: Send + 'static>
21        + Clone
22        + Send
23        + Sync
24        + 'static
25{
26}