[−][src]Struct futures_util::future::Shared
#[must_use = "futures do nothing unless polled"]pub struct Shared<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::Output>>
[src]
pub fn peek(&self) -> Option<Arc<Fut::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: Future> Unpin for Shared<Fut>
[src]
impl<Fut: Future> Unpin for Shared<Fut>
impl<Fut: Future> Debug for Shared<Fut>
[src]
impl<Fut: Future> Debug for Shared<Fut>
fn fmt(&self, fmt: &mut Formatter) -> Result
[src]
fn fmt(&self, fmt: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<Fut: Future> Future for Shared<Fut>
[src]
impl<Fut: Future> Future for Shared<Fut>
type Output = Arc<Fut::Output>
🔬 This is a nightly-only experimental API. (futures_api
)
futures in libcore are unstable
The result of the Future
.
fn poll(self: PinMut<Self>, cx: &mut Context) -> Poll<Self::Output>
[src]
fn poll(self: PinMut<Self>, cx: &mut Context) -> Poll<Self::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
impl<Fut> Clone for Shared<Fut> where
Fut: Future,
[src]
impl<Fut> Clone for Shared<Fut> where
Fut: Future,
fn clone(&self) -> Self
[src]
fn clone(&self) -> Self
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> Drop for Shared<Fut> where
Fut: Future,
[src]
impl<Fut> Drop for Shared<Fut> where
Fut: Future,