mirror of
https://github.com/OMGeeky/tarpc.git
synced 2026-02-23 15:49:54 +01:00
Move generated functions under their corresponding items.
- fn serve -> Service::serve - fn new_stub -> Client::new This allows the generated function names to remain consistent across service definitions while preventing collisions.
This commit is contained in:
@@ -46,16 +46,15 @@ impl<T> Deadline<T> {
|
||||
}
|
||||
impl<T> Future for Deadline<T>
|
||||
where
|
||||
T: TryFuture,
|
||||
T: Future,
|
||||
{
|
||||
type Output = Result<T::Ok, timeout::Error<T::Error>>;
|
||||
type Output = Result<T::Output, timeout::Error<()>>;
|
||||
|
||||
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
|
||||
// First, try polling the future
|
||||
match self.as_mut().future().try_poll(cx) {
|
||||
Poll::Ready(Ok(v)) => return Poll::Ready(Ok(v)),
|
||||
match self.as_mut().future().poll(cx) {
|
||||
Poll::Ready(v) => return Poll::Ready(Ok(v)),
|
||||
Poll::Pending => {}
|
||||
Poll::Ready(Err(e)) => return Poll::Ready(Err(timeout::Error::inner(e))),
|
||||
}
|
||||
|
||||
let delay = self.delay().poll_unpin(cx);
|
||||
|
||||
Reference in New Issue
Block a user