[−][src]Struct yaar::task::FutureTask
A combination of a task and a given future
which implements Task
based waking and polling.
For convenience purposes in regards to the executors, the task also stores and caches the output of the future.
Fields
task: Task
Methods
impl<F: Future> FutureTask<F>
[src]
pub fn new(priority: Priority, future: F) -> Self
[src]
Create a new future + task wrapper.
pub fn into_output(self) -> Option<F::Output>
[src]
Convert the FutureTask into its underlying output value.
pub fn resume(&mut self) -> Poll<&F::Output>
[src]
Resume the future wrapped task, returning the resulting output.
This effectively calls Future::poll()
with the waker and context
setup to resume the future using the task as a reference if the
futures output is not already polled() and stored.
Trait Implementations
impl<F: Future> Future for FutureTask<F>
[src]
type Output = NonNull<F::Output>
The type of value produced on completion.
fn poll(self: Pin<&mut Self>, ctx: &mut Context) -> Poll<Self::Output>
[src]
Polls the FutureTask for the result or returns the cached output as a NonNull pointer.
This returns a pointer instead of an immutable reference since rust doesnt allow
references for type annotations for Future::Output
.
impl<F: Future> Unpin for FutureTask<F>
[src]
Auto Trait Implementations
impl<F> Send for FutureTask<F> where
F: Send,
<F as Future>::Output: Send,
F: Send,
<F as Future>::Output: Send,
impl<F> Sync for FutureTask<F> where
F: Sync,
<F as Future>::Output: Sync,
F: Sync,
<F as Future>::Output: Sync,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,