pub trait AsyncDrop:
Default
+ PartialEq
+ Eq
+ ResetDefault {
// Provided methods
fn async_drop<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), AsyncDropError>> + Send + 'async_trait>>
where Self: Send + 'async_trait,
'life0: 'async_trait { ... }
fn reset(&mut self) { ... }
fn drop_timeout(&self) -> Duration { ... }
fn drop_fail_action(&self) -> DropFailAction { ... }
}
Expand description
The operative trait that enables AsyncDrop functionality. Normally, implementing only async_drop(&mut self) and reset(&mut self) is necessary.
Provided Methods§
Sourcefn async_drop<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), AsyncDropError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
fn async_drop<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), AsyncDropError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
Operative drop that does async operations, returning
Sourcefn reset(&mut self)
fn reset(&mut self)
A way to reset the object (set all it’s internal members to their default). This method is used after a successful AsyncDrop, to ensure that future drops do not perform async_drop behavior twice.
Sourcefn drop_timeout(&self) -> Duration
fn drop_timeout(&self) -> Duration
Timeout for drop operation, meant to be overriden if needed
Sourcefn drop_fail_action(&self) -> DropFailAction
fn drop_fail_action(&self) -> DropFailAction
What to do what a drop fails
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.