state: Add an Error type alias to ZebraState
This commit is contained in:
parent
4181c8a5d5
commit
8072d5b7e8
|
|
@ -1,7 +1,7 @@
|
||||||
use super::{Request, Response};
|
use super::{Request, Response};
|
||||||
use futures::prelude::*;
|
use futures::prelude::*;
|
||||||
use std::{
|
use std::{
|
||||||
error::Error,
|
error,
|
||||||
future::Future,
|
future::Future,
|
||||||
pin::Pin,
|
pin::Pin,
|
||||||
task::{Context, Poll},
|
task::{Context, Poll},
|
||||||
|
|
@ -15,9 +15,11 @@ struct ZebraState {
|
||||||
index: block_index::BlockIndex,
|
index: block_index::BlockIndex,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Error = Box<dyn error::Error + Send + Sync + 'static>;
|
||||||
|
|
||||||
impl Service<Request> for ZebraState {
|
impl Service<Request> for ZebraState {
|
||||||
type Response = Response;
|
type Response = Response;
|
||||||
type Error = Box<dyn Error + Send + Sync + 'static>;
|
type Error = Error;
|
||||||
type Future =
|
type Future =
|
||||||
Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>> + Send + 'static>>;
|
Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>> + Send + 'static>>;
|
||||||
|
|
||||||
|
|
@ -58,8 +60,8 @@ impl Service<Request> for ZebraState {
|
||||||
pub fn init() -> impl Service<
|
pub fn init() -> impl Service<
|
||||||
Request,
|
Request,
|
||||||
Response = Response,
|
Response = Response,
|
||||||
Error = Box<dyn Error + Send + Sync + 'static>,
|
Error = Error,
|
||||||
Future = impl Future<Output = Result<Response, Box<dyn Error + Send + Sync + 'static>>>,
|
Future = impl Future<Output = Result<Response, Error>>,
|
||||||
> + Send
|
> + Send
|
||||||
+ Clone
|
+ Clone
|
||||||
+ 'static {
|
+ 'static {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue