[][src]Struct tokio::prelude::future::Shared

#[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]

pub fn peek(
    &self
) -> Option<Result<SharedItem<<F as Future>::Item>, SharedError<<F as Future>::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> Clone for Shared<F> where
    F: Future
[src]

impl<F> Debug for Shared<F> where
    F: Future + Debug,
    <F as Future>::Item: Debug,
    <F as Future>::Error: Debug
[src]

impl<F> Drop for Shared<F> where
    F: Future
[src]

impl<F> Future for Shared<F> where
    F: Future
[src]

type Item = SharedItem<<F as Future>::Item>

The type of value that this future will resolved with if it is successful. Read more

type Error = SharedError<<F as Future>::Error>

The type of error that this future will resolve with if it fails in a normal fashion. Read more

Auto Trait Implementations

impl<F> !RefUnwindSafe for Shared<F>

impl<F> Send for Shared<F> where
    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

impl<F> Unpin for Shared<F>

impl<F> !UnwindSafe for Shared<F>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<F> IntoFuture for F where
    F: Future
[src]

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.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.