Struct futures::future::Shared [−][src]
#[must_use = "futures do nothing unless polled"]pub struct Shared<F> where
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]
impl<F> Shared<F> where
F: Future,
pub fn peek(
&self
) -> Option<Result<SharedItem<<F as Future>::Item>, SharedError<<F as Future>::Error>>>
[src]
pub fn peek(
&self
) -> Option<Result<SharedItem<<F as Future>::Item>, SharedError<<F as Future>::Error>>>
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 as Future>::Item: Debug,
<F as Future>::Error: Debug,
[src]
impl<F> Debug for Shared<F> where
F: Future + Debug,
<F as Future>::Item: Debug,
<F as Future>::Error: Debug,
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<F> Clone for Shared<F> where
F: Future,
[src]
impl<F> Clone for Shared<F> where
F: Future,
fn clone(&self) -> Shared<F>
[src]
fn clone(&self) -> Shared<F>
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<F> Drop for Shared<F> where
F: Future,
[src]
impl<F> Drop for Shared<F> where
F: Future,
impl<F> Future for Shared<F> where
F: Future,
[src]
impl<F> Future for Shared<F> where
F: Future,
type Item = SharedItem<<F as Future>::Item>
A successful value
type Error = SharedError<<F as Future>::Error>
An error
fn poll(
&mut self,
cx: &mut Context
) -> Result<Async<<Shared<F> as Future>::Item>, <Shared<F> as Future>::Error>
[src]
fn poll(
&mut self,
cx: &mut Context
) -> Result<Async<<Shared<F> as Future>::Item>, <Shared<F> as Future>::Error>
Attempt to resolve the future to a final value, registering the current task for wakeup if the value is not yet available. Read more