Struct futures_util::future::Shared
[−]
[src]
#[must_use = "futures do nothing unless polled"]pub struct Shared<F: Future> { /* fields omitted */ }
A future that is cloneable and can be polled in multiple threads.
Use Future::shared()
method to convert any future into a Shared
future.
Methods
impl<F> Shared<F> where
F: Future,
[src]
F: Future,
pub fn peek(&self) -> Option<Result<SharedItem<F::Item>, SharedError<F::Error>>>
[src]
If any clone of this Shared
has completed execution, returns its result immediately
without blocking. Otherwise, returns None without triggering the work represented by
this Shared
.
Trait Implementations
impl<F> Debug for Shared<F> where
F: Future + Debug,
F::Item: Debug,
F::Error: Debug,
[src]
F: Future + Debug,
F::Item: Debug,
F::Error: Debug,
fn fmt(&self, fmt: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<F> Future for Shared<F> where
F: Future,
[src]
F: Future,
type Item = SharedItem<F::Item>
A successful value
type Error = SharedError<F::Error>
An error
fn poll(&mut self, cx: &mut Context) -> Poll<Self::Item, Self::Error>
[src]
Attempt to resolve the future to a final value, registering the current task for wakeup if the value is not yet available. Read more
impl<F> Clone for Shared<F> where
F: Future,
[src]
F: Future,
fn clone(&self) -> Self
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<F> Drop for Shared<F> where
F: Future,
[src]
F: Future,