pub struct TokioTaskStrategy();Available on crate feature
tokio only.Expand description
Strategy which spawns a new tokio task which drops the contained value.
This only works within the context of a Tokio runtime. (Dropping objects constructed with this strategy while no Tokio runtime is available will result in a panic!)
Since the overhead of creating new Tokio tasks is very small, this is really fast (at least from the perspective of the current task.)
Note that if dropping your value takes a very long time, you might be better off
using TokioBlockingTaskStrategy instead. Benchmark!
Trait Implementations§
Source§impl<T: Send + 'static> BackdropStrategy<T> for TokioTaskStrategy
impl<T: Send + 'static> BackdropStrategy<T> for TokioTaskStrategy
Auto Trait Implementations§
impl Freeze for TokioTaskStrategy
impl RefUnwindSafe for TokioTaskStrategy
impl Send for TokioTaskStrategy
impl Sync for TokioTaskStrategy
impl Unpin for TokioTaskStrategy
impl UnwindSafe for TokioTaskStrategy
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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