pub struct AbortablePool<T> { /* private fields */ }
Expand description
An unordered pool of futures that can be individually aborted.
Each future added to the pool returns an Aborter. When the aborter is dropped, the associated future is aborted.
Note: This pool is not thread-safe and should not be used across threads without external synchronization.
Implementations§
Source§impl<T: Send> AbortablePool<T>
impl<T: Send> AbortablePool<T>
Sourcepub fn next_completed(
&mut self,
) -> SelectNextSome<'_, FuturesUnordered<Pin<Box<dyn Future<Output = Result<T, Aborted>> + Send>>>>
pub fn next_completed( &mut self, ) -> SelectNextSome<'_, FuturesUnordered<Pin<Box<dyn Future<Output = Result<T, Aborted>> + Send>>>>
Returns a future that resolves to the next future in the pool that resolves.
If the pool is empty, the future will never resolve.
Returns Ok(T)
for successful completion or Err(Aborted)
for aborted futures.
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for AbortablePool<T>
impl<T> !RefUnwindSafe for AbortablePool<T>
impl<T> Send for AbortablePool<T>
impl<T> !Sync for AbortablePool<T>
impl<T> Unpin for AbortablePool<T>
impl<T> !UnwindSafe for AbortablePool<T>
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