Struct gidle_future::Handle [−][src]
pub struct Handle<T> { /* fields omitted */ }
A handle to a running idle future.
You can use this handle to cancel the future and to retrieve the return value of a future that has finished.
If the Handle is dropped, the future will keep on running, and there will be no way to cancel it or get the return value.
Implementations
impl<T> Handle<T>
[src]
impl<T> Handle<T>
[src]pub fn cancel(self) -> Option<T>
[src]
pub fn cancel(self) -> Option<T>
[src]If the future has finished, it returns Some(t)
.
If it has not finished, the future is dropped and it returns None
.
pub fn has_finished(&self) -> bool
[src]
pub fn has_finished(&self) -> bool
[src]Returns true
if the future has finished, false
otherwise.
If it returns true
then you can be sure that cancel
will return Some(t)
.