pub struct LifecycleHandle { /* private fields */ }Expand description
Handle returned by LifecycleManager::spawn. Dropping it does not
stop the loop — the caller must .stop().await explicitly, so a
CLI handler that accidentally drops the handle doesn’t silently kill
the background worker.
Implementations§
Source§impl LifecycleHandle
impl LifecycleHandle
Sourcepub fn cancellation_token(&self) -> CancellationToken
pub fn cancellation_token(&self) -> CancellationToken
Clone the cancellation token so sub-tasks can share shutdown.
Auto Trait Implementations§
impl Freeze for LifecycleHandle
impl RefUnwindSafe for LifecycleHandle
impl Send for LifecycleHandle
impl Sync for LifecycleHandle
impl Unpin for LifecycleHandle
impl UnsafeUnpin for LifecycleHandle
impl UnwindSafe for LifecycleHandle
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