pub struct ShutdownPlugin { /* private fields */ }Expand description
Process-wide ShutdownPlugin singleton wrapping ShutdownCoordinator.
Implementations§
Source§impl ShutdownPlugin
Inherent implementation of ShutdownPlugin.
impl ShutdownPlugin
Inherent implementation of ShutdownPlugin.
Sourcepub fn init(coordinator: ShutdownCoordinator) -> &'static Self
pub fn init(coordinator: ShutdownCoordinator) -> &'static Self
Initializes the global ShutdownPlugin once with coordinator.
§Arguments
ShutdownCoordinator- Configured graceful shutdown coordinator.
§Returns
&'static Self- Reference to the initialized global plugin.
Sourcepub fn get() -> Option<&'static Self>
pub fn get() -> Option<&'static Self>
Returns the initialized global ShutdownPlugin, if initialized.
§Returns
Option<&'static Self>- Reference to the global plugin, orNone.
Sourcepub fn get_coordinator(&self) -> &ShutdownCoordinator
pub fn get_coordinator(&self) -> &ShutdownCoordinator
Returns the shared ShutdownCoordinator.
§Returns
&ShutdownCoordinator- Active shutdown coordinator.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ShutdownPlugin
impl !UnwindSafe for ShutdownPlugin
impl Forget for ShutdownPlugin
impl Freeze for ShutdownPluginwhere
*const ArcInner<ShutdownCoordinatorInner> is !null: Freeze,
PhantomData<ArcInner<ShutdownCoordinatorInner>>: Freeze,
impl Move for ShutdownPlugin
impl Send for ShutdownPlugin
impl Sync for ShutdownPlugin
impl Unpin for ShutdownPlugin
impl UnsafeUnpin for ShutdownPluginwhere
*const ArcInner<ShutdownCoordinatorInner> is !null: UnsafeUnpin,
PhantomData<ArcInner<ShutdownCoordinatorInner>>: UnsafeUnpin,
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone for T
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