pub struct ShutdownTrigger { /* private fields */ }Expand description
Cloneable initiator handle.
Hand one of these to any code path that may need to ask for shutdown.
Implementations§
Source§impl ShutdownTrigger
impl ShutdownTrigger
Sourcepub fn trigger(&self, reason: ShutdownReason) -> bool
pub fn trigger(&self, reason: ShutdownReason) -> bool
Initiate shutdown with the given reason.
Returns true if this call performed the transition;
false if it was already initiated.
Sourcepub fn is_initiated(&self) -> bool
pub fn is_initiated(&self) -> bool
true if shutdown has been initiated.
Trait Implementations§
Source§impl Clone for ShutdownTrigger
impl Clone for ShutdownTrigger
Source§fn clone(&self) -> ShutdownTrigger
fn clone(&self) -> ShutdownTrigger
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ShutdownTrigger
impl !RefUnwindSafe for ShutdownTrigger
impl Send for ShutdownTrigger
impl Sync for ShutdownTrigger
impl Unpin for ShutdownTrigger
impl UnsafeUnpin for ShutdownTrigger
impl !UnwindSafe for ShutdownTrigger
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