pub struct AbortOnDropHandle(/* private fields */);Expand description
A handle that aborts its associated future when dropped.
Similar to https://docs.rs/tokio-util/latest/tokio_util/task/struct.AbortOnDropHandle.html but runtime agnostic.
This is created from the abort_on_drop function.
This is useful in Makepad to ensure tasks gets cancelled on widget drop instead of keep running in the background unnoticed.
Note: In makepad, widgets may be cached or reused causing this to not work as expected in many scenarios.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AbortOnDropHandle
impl !RefUnwindSafe for AbortOnDropHandle
impl Send for AbortOnDropHandle
impl Sync for AbortOnDropHandle
impl Unpin for AbortOnDropHandle
impl !UnwindSafe for AbortOnDropHandle
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