pub struct AsyncScope<'a> { /* private fields */ }Available on crate feature
alloc only.Expand description
Convenience name for LocalAsyncScope.
Use SendAsyncScope when the scope must cross thread boundaries.
A LIFO stack of local asynchronous cleanup actions.
Each registration stores one boxed wrapper future. The cleanup factory is invoked only when that wrapper is first polled, and actions are awaited sequentially.
Dropping a pending LocalRun leaves its current action in the stack. A
later run resumes it after any newer LIFO entries. Dropping the scope itself
drops all remaining actions without polling them further.
Implementations§
Source§impl<'a> LocalAsyncScope<'a>
impl<'a> LocalAsyncScope<'a>
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates an empty scope with space for at least capacity actions.
Sourcepub fn capacity(&self) -> usize
pub fn capacity(&self) -> usize
Returns the number of actions the scope can hold without reallocating.
Trait Implementations§
Source§impl Debug for LocalAsyncScope<'_>
impl Debug for LocalAsyncScope<'_>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for LocalAsyncScope<'a>
impl<'a> !Send for LocalAsyncScope<'a>
impl<'a> !Sync for LocalAsyncScope<'a>
impl<'a> !UnwindSafe for LocalAsyncScope<'a>
impl<'a> Freeze for LocalAsyncScope<'a>
impl<'a> Unpin for LocalAsyncScope<'a>
impl<'a> UnsafeUnpin for LocalAsyncScope<'a>
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