Struct futures::future::Shared [−][src]
#[must_use = "futures do nothing unless polled"]pub struct Shared<Fut> where
Fut: 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<Fut> Shared<Fut> where
Fut: Future,
[src]
impl<Fut> Shared<Fut> where
Fut: Future,
pub fn peek(&self) -> Option<Arc<<Fut as Future>::Output>>
[src]
pub fn peek(&self) -> Option<Arc<<Fut as Future>::Output>>
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<Fut> Unpin for Shared<Fut> where
Fut: Future,
[src]
impl<Fut> Unpin for Shared<Fut> where
Fut: Future,
impl<Fut> Drop for Shared<Fut> where
Fut: Future,
[src]
impl<Fut> Drop for Shared<Fut> where
Fut: Future,
impl<Fut> Clone for Shared<Fut> where
Fut: Future,
[src]
impl<Fut> Clone for Shared<Fut> where
Fut: Future,
fn clone(&self) -> Shared<Fut>
[src]
fn clone(&self) -> Shared<Fut>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<Fut> Debug for Shared<Fut> where
Fut: Future,
[src]
impl<Fut> Debug for Shared<Fut> where
Fut: Future,
fn fmt(&self, fmt: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, fmt: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl<Fut> Future for Shared<Fut> where
Fut: Future,
[src]
impl<Fut> Future for Shared<Fut> where
Fut: Future,
type Output = Arc<<Fut as Future>::Output>
🔬 This is a nightly-only experimental API. (futures_api
)
futures in libcore are unstable
The result of the Future
.
fn poll(
self: PinMut<Shared<Fut>>,
cx: &mut Context
) -> Poll<<Shared<Fut> as Future>::Output>
[src]
fn poll(
self: PinMut<Shared<Fut>>,
cx: &mut Context
) -> Poll<<Shared<Fut> as Future>::Output>
🔬 This is a nightly-only experimental API. (futures_api
)
futures in libcore are unstable
Attempt to resolve the future to a final value, registering the current task for wakeup if the value is not yet available. Read more