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>
impl<ID, O> FuturesMap<ID, O>
sourcepub fn try_push<F>(
&mut self,
future_id: ID,
future: F
) -> Result<(), PushError<BoxFuture<'_, O>>>
pub fn try_push<F>( &mut self, future_id: ID, future: F ) -> Result<(), PushError<BoxFuture<'_, O>>>
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::Replaced contains the old future.
pub fn remove(&mut self, id: ID) -> Option<BoxFuture<'static, O>>
pub fn contains(&self, id: ID) -> bool
pub fn len(&self) -> usize
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> !Freeze for FuturesMap<ID, O>
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