pub(crate) struct AbortOnDrop {
task: JoinHandle<()>,
}Expand description
A spawned task that is aborted when this value is dropped.
Used for a session’s command task, which has no natural end of its own: it waits on a channel and on a cancellation token, and if the session’s future is dropped without either firing — which is what happens when whoever spawned the session aborts it — the task would otherwise outlive the session that owns it, holding the session’s context alive with it.
Fields§
§task: JoinHandle<()>Implementations§
Trait Implementations§
Source§impl Drop for AbortOnDrop
impl Drop for AbortOnDrop
Auto Trait Implementations§
impl Freeze for AbortOnDrop
impl RefUnwindSafe for AbortOnDrop
impl Send for AbortOnDrop
impl Sync for AbortOnDrop
impl Unpin for AbortOnDrop
impl UnsafeUnpin for AbortOnDrop
impl UnwindSafe for AbortOnDrop
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