[−][src]Struct futures::future::Shared
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> Future for Shared<F> where
F: Future,
[src][+]
F: Future,
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,
impl<F> Drop for Shared<F> where
F: Future,
[src][+]
F: Future,
impl<F> Clone for Shared<F> where
F: Future,
[src][+]
F: Future,
Auto Trait Implementations
impl<F> Send for Shared<F> where
F: Send,
<F as Future>::Error: Send + Sync,
<F as Future>::Item: Send + Sync,
F: Send,
<F as Future>::Error: Send + Sync,
<F as Future>::Item: Send + Sync,
impl<F> Sync for Shared<F> where
F: Send,
<F as Future>::Error: Send + Sync,
<F as Future>::Item: Send + Sync,
F: Send,
<F as Future>::Error: Send + Sync,
<F as Future>::Item: Send + Sync,
Blanket Implementations
impl<F> IntoFuture for F where
F: Future,
[src][−]
F: Future,
type Future = F
The future that this type can be converted into.
type Item = <F as Future>::Item
The item that the future may resolve with.
type Error = <F as Future>::Error
The error that the future may resolve with.
fn into_future(Self) -> F
[src][−]
impl<T, U> TryFrom for T where
T: From<U>,
[src][−]
T: From<U>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src][−]
impl<T> From for T
[src][−]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src][−]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src][−]
impl<T, U> Into for T where
U: From<T>,
[src][−]
U: From<T>,
impl<T> Borrow for T where
T: ?Sized,
[src][−]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src][−]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src][−]
impl<T> Any for T where
T: 'static + ?Sized,
[src][−]
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src][−]
impl<T> ToOwned for T where
T: Clone,
[src][−]
T: Clone,