pub struct FuturesTupleSet<O, D> { /* private fields */ }
Expand description

Represents a list of tuples of a Future and an associated piece of data.

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

Implementations§

source§

impl<O, D> FuturesTupleSet<O, D>

source

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

source§

impl<O, D> FuturesTupleSet<O, D>where O: 'static,

source

pub fn try_push<F>( &mut self, future: F, data: D ) -> Result<(), (BoxFuture<'_, O>, D)>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 len(&self) -> usize

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>, D)>

Auto Trait Implementations§

§

impl<O, D> !RefUnwindSafe for FuturesTupleSet<O, D>

§

impl<O, D> Send for FuturesTupleSet<O, D>where D: Send,

§

impl<O, D> !Sync for FuturesTupleSet<O, D>

§

impl<O, D> Unpin for FuturesTupleSet<O, D>where D: Unpin,

§

impl<O, D> !UnwindSafe for FuturesTupleSet<O, D>

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.