Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use std::future::Future;
- use std::pin::Pin;
- use std::task::{Context, Poll};
- trait Service<Request> {
- type Response;
- type Error;
- type Future: Future<Output = Result<Self::Response, Self::Error>>;
- // perhaps this should return a readiness token
- // that is then passed to `Call`?
- fn poll_ready(self: Pin<&mut Self>, ctx: Context) -> Poll<()>;
- fn call(self: Pin<&mut Self>, req: Request) -> Self::Future;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement