Expand description
§Example
#![feature(futures_api)]
use std::pin::Pin;
use std::task::{Poll, Waker};
use futures::prelude::*;
use std::io;
struct Fut;
impl Future for Fut {
type Output = ();
fn poll(self: Pin<&mut Self>, waker: &Waker) -> Poll<Self::Output> {
Poll::Ready(())
}
}
impl ready::Ready for Fut {
type Ok = ();
type Err = io::Error;
fn poll_ready(&mut self, waker: &Waker)
-> Poll<Result<Self::Ok, Self::Err>> {
Poll::Ready(Ok(()))
}
}
Traits§
- Read
Ready - Determine if the underlying API can be read from.
- Ready
- Determine if a struct is ready to yield futures.
- Take
Error - Extract an error from the underlying struct that isn’t propagated through regular channels.
- Write
Ready - Determine if the underlying API can be written to.