Struct futures_bounded::FuturesMap
source · pub struct FuturesMap<ID, O> { /* private fields */ }
Expand description
Represents a map of Future
s.
Each future must finish within the specified time and the map never outgrows its capacity.
Implementations§
source§impl<ID, O> FuturesMap<ID, O>where
ID: Clone + Hash + Eq + Send + Unpin + 'static,
impl<ID, O> FuturesMap<ID, O>where ID: Clone + Hash + Eq + Send + Unpin + 'static,
sourcepub fn try_push<F>(
&mut self,
future_id: ID,
future: F
) -> Result<(), PushError<BoxFuture<'_, O>>>where
F: Future<Output = O> + Send + 'static,
pub fn try_push<F>( &mut self, future_id: ID, future: F ) -> Result<(), PushError<BoxFuture<'_, O>>>where F: Future<Output = O> + Send + 'static,
Push a future into the map.
This method inserts the given future with defined future_id
to the set.
If the length of the map is equal to the capacity, this method returns PushError::BeyondCapacity,
that contains the passed future. In that case, the future is not inserted to the map.
If a future with the given future_id
already exists, then the old future will be replaced by a new one.
In that case, the returned error PushError::ReplacedFuture contains the old future.
pub fn is_empty(&self) -> bool
pub fn poll_ready_unpin(&mut self, cx: &mut Context<'_>) -> Poll<()>
pub fn poll_unpin( &mut self, cx: &mut Context<'_> ) -> Poll<(ID, Result<O, Timeout>)>
Auto Trait Implementations§
impl<ID, O> !RefUnwindSafe for FuturesMap<ID, O>
impl<ID, O> Send for FuturesMap<ID, O>where ID: Send,
impl<ID, O> !Sync for FuturesMap<ID, O>
impl<ID, O> Unpin for FuturesMap<ID, O>
impl<ID, O> !UnwindSafe for FuturesMap<ID, O>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more