pub struct FuturesSet<O> { /* private fields */ }
Expand description

Represents a list of Futures.

Each future must finish within the specified time and the list never outgrows its capacity.

Implementations§

source§

impl<O> FuturesSet<O>

source

pub fn new(timeout: Duration, capacity: usize) -> Self

source§

impl<O> FuturesSet<O>

source

pub fn try_push<F>(&mut self, future: F) -> Result<(), BoxFuture<'_, O>>where F: Future<Output = O> + Send + 'static,

Push a future into the list.

This method adds the given future to the list. If the length of the list is equal to the capacity, this method returns a error that contains the passed future. In that case, the future is not added to the set.

source

pub fn is_empty(&self) -> bool

source

pub fn poll_ready_unpin(&mut self, cx: &mut Context<'_>) -> Poll<()>

source

pub fn poll_unpin(&mut self, cx: &mut Context<'_>) -> Poll<Result<O, Timeout>>

Auto Trait Implementations§

§

impl<O> !RefUnwindSafe for FuturesSet<O>

§

impl<O> Send for FuturesSet<O>

§

impl<O> !Sync for FuturesSet<O>

§

impl<O> Unpin for FuturesSet<O>

§

impl<O> !UnwindSafe for FuturesSet<O>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.