Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. use std::future::Future;
  2. use std::pin::Pin;
  3. use std::task::{Context, Poll};
  4.  
  5. trait Service<Request> {
  6. type Response;
  7. type Error;
  8. type Future: Future<Output = Result<Self::Response, Self::Error>>;
  9. // perhaps this should return a readiness token
  10. // that is then passed to `Call`?
  11. fn poll_ready(self: Pin<&mut Self>, ctx: Context) -> Poll<()>;
  12. fn call(self: Pin<&mut Self>, req: Request) -> Self::Future;
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement