pub struct AsyncDropx<T: AsyncDrop + Send + 'static> { /* private fields */ }Expand description
Wrapper that ensures async_drop is called when the object goes out of scope.
This wrapper implements Deref and DerefMut, so you can use it just like the inner type.
When it goes out of scope, Drop is called, which takes the inner value and spawns
the future returned by async_drop on the active async runtime.
Supported runtimes:
tokio(requirestokiofeature)async-std(requiresasync-stdfeature)
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for AsyncDropx<T>where
T: Freeze,
impl<T> RefUnwindSafe for AsyncDropx<T>where
T: RefUnwindSafe,
impl<T> Send for AsyncDropx<T>
impl<T> Sync for AsyncDropx<T>where
T: Sync,
impl<T> Unpin for AsyncDropx<T>where
T: Unpin,
impl<T> UnwindSafe for AsyncDropx<T>where
T: UnwindSafe,
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