Struct completable_future::CompletableFuture
[−]
[src]
pub struct CompletableFuture<V, E> { /* fields omitted */ }
A CompletableFuture is a future that you can expect a result (or error) from and chain logic on. You will need some executor to actively poll the result. Executors provided by the futures crate are usually good enough for common situations.
If you use a custom executor, be careful that don't poll the CompletableFuture after it has already completed (or errored) in previous polls. Doing so will panic your executor.
Methods
impl<V, E> CompletableFuture<V, E>
[src]
pub fn new() -> CompletableFuture<V, E>
[src]
Construct a CompletableFuture.
pub fn completed(val: V) -> CompletableFuture<V, E>
[src]
Construct a CompletableFuture that's already completed with the value provided.
pub fn errored(e: E) -> CompletableFuture<V, E>
[src]
Construct a CompletableFuture that's already errored with the value provided.
pub fn signal(&self) -> CompletableFutureSignal<V, E>
[src]
Get a CompletableFutureSignal that can be used to complete or error this CompletableFuture.
Trait Implementations
impl<V, E> Future for CompletableFuture<V, E>
[src]
Auto Trait Implementations
impl<V, E> Send for CompletableFuture<V, E> where
E: Send,
V: Send,
E: Send,
V: Send,
impl<V, E> Sync for CompletableFuture<V, E> where
E: Send,
V: Send,
E: Send,
V: Send,