Struct futures_util::future::Shared [−][src]
#[must_use = "futures do nothing unless you `.await` or poll them"]pub struct Shared<Fut: Future> { /* fields omitted */ }
Future for the shared
method.
Implementations
impl<Fut> Shared<Fut> where
Fut: Future,
Fut::Output: Clone,
[src]
impl<Fut> Shared<Fut> where
Fut: Future,
Fut::Output: Clone,
[src]pub fn peek(&self) -> Option<&Fut::Output>
[src]
Returns Some
containing a reference to this Shared
’s output if
it has already been computed by a clone or None
if it hasn’t been
computed yet or this Shared
already returned its output from
poll
.
pub fn downgrade(&self) -> Option<WeakShared<Fut>>
[src]
Creates a new WeakShared
for this Shared
.
Returns None
if it has already been polled to completion.
Trait Implementations
impl<Fut> Clone for Shared<Fut> where
Fut: Future,
[src]
impl<Fut> Clone for Shared<Fut> where
Fut: Future,
[src]fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<Fut> FusedFuture for Shared<Fut> where
Fut: Future,
Fut::Output: Clone,
[src]
impl<Fut> FusedFuture for Shared<Fut> where
Fut: Future,
Fut::Output: Clone,
[src]fn is_terminated(&self) -> bool
[src]
impl<Fut: Future> Unpin for Shared<Fut>
[src]
Auto Trait Implementations
impl<Fut> !RefUnwindSafe for Shared<Fut>
impl<Fut> Send for Shared<Fut> where
Fut: Send,
<Fut as Future>::Output: Send + Sync,
Fut: Send,
<Fut as Future>::Output: Send + Sync,
impl<Fut> Sync for Shared<Fut> where
Fut: Send,
<Fut as Future>::Output: Send + Sync,
Fut: Send,
<Fut as Future>::Output: Send + Sync,
impl<Fut> !UnwindSafe for Shared<Fut>
Blanket Implementations
impl<F> IntoFuture for F where
F: Future,
[src]
impl<F> IntoFuture for F where
F: Future,
[src]type Output = <F as Future>::Output
🔬 This is a nightly-only experimental API. (
into_future
)The output that the future will produce on completion.
type Future = F
🔬 This is a nightly-only experimental API. (
into_future
)Which kind of future are we turning this into?