pub struct ShutdownSignal { /* private fields */ }Expand description
Signals a running bot to stop
Cloneable and cheap; every clone signals the same bot. Dropping every clone
does not stop the bot — call ShutdownSignal::shutdown for that.
Implementations§
Source§impl ShutdownSignal
impl ShutdownSignal
Sourcepub fn shutdown(&self)
pub fn shutdown(&self)
Ask the bot to stop
Returns immediately; the bot stops once it reaches its next await point. Calling this more than once is harmless.
Sourcepub fn is_shutdown(&self) -> bool
pub fn is_shutdown(&self) -> bool
Whether shutdown has already been requested
Trait Implementations§
Source§impl Clone for ShutdownSignal
impl Clone for ShutdownSignal
Source§fn clone(&self) -> ShutdownSignal
fn clone(&self) -> ShutdownSignal
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 ShutdownSignal
impl RefUnwindSafe for ShutdownSignal
impl Send for ShutdownSignal
impl Sync for ShutdownSignal
impl Unpin for ShutdownSignal
impl UnsafeUnpin for ShutdownSignal
impl UnwindSafe for ShutdownSignal
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