pub struct PluginLifecycle { /* private fields */ }Expand description
Per-plugin lifecycle handle.
Constructed at Uni::add_plugin time; advanced through the states
by the loader. The state is held in an AtomicU8 so wait-free
reads work from the query path (e.g., to short-circuit dispatch
against a draining plugin).
Implementations§
Source§impl PluginLifecycle
impl PluginLifecycle
Sourcepub fn new(plugin: PluginId) -> Self
pub fn new(plugin: PluginId) -> Self
Construct in LifecycleState::Loaded.
Sourcepub fn state(&self) -> LifecycleState
pub fn state(&self) -> LifecycleState
Current state.
Sourcepub fn advance(&self) -> LifecycleState
pub fn advance(&self) -> LifecycleState
Advance to the next state. Returns the new state.
Forward-only: invocation when already at LifecycleState::Removed
stays at Removed.
Sourcepub fn set(&self, s: LifecycleState)
pub fn set(&self, s: LifecycleState)
Force-set the state. Useful for tests and for unwinding a failed
register() back to Loaded.
Sourcepub fn is_winding_down(&self) -> bool
pub fn is_winding_down(&self) -> bool
Returns true if the plugin is in Draining or Removed.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for PluginLifecycle
impl RefUnwindSafe for PluginLifecycle
impl Send for PluginLifecycle
impl Sync for PluginLifecycle
impl Unpin for PluginLifecycle
impl UnsafeUnpin for PluginLifecycle
impl UnwindSafe for PluginLifecycle
Blanket Implementations§
impl<T> Allocation 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more