SHARE
TWEET

Untitled

a guest Jun 15th, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top