[][src]Enum nuts::LifecycleStatus

#[non_exhaustive]pub enum LifecycleStatus {
    Active,
    Inactive,
    Deleted,
}

Each activity has a lifecycle status that can be changed using set_status. It starts with LifecycleStatus::Active. In the current version of Nuts, the only other status is LifecycleStatus::Inactive.

The inactive status can be used to put activities to sleep temporarily. While inactive, the activity will not be notified of events it has subscribed to. A subscription filter can been used to change this behavior. (See subscribe_masked)

If the status of a changes from active to inactive, the activity's on_leave and on_leave_domained subscriptions will be called.

If the status of a changes from inactive to active, the activity's on_enter and on_enter_domained subscriptions will be called.

Variants (Non-exhaustive)

Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Active

The normal status. Every Activity starts with this status.

Inactive

Inactive / Sleeping

Deleted

Mark for deletion, the activity will be removed and on_delete called on it. Setting to this state twice will cause panics.

Implementations

impl LifecycleStatus[src]

pub fn is_active(&self) -> bool[src]

Returns true iff the status is one that is considered to be active. (Only LifecycleStatus::Active at the moment)

Use this method instead of a == comparison with LifecycleStatus::Active to keep compatibility with future versions of Nuts that may add other status variants.

Trait Implementations

impl Clone for LifecycleStatus[src]

impl Copy for LifecycleStatus[src]

impl Debug for LifecycleStatus[src]

impl Eq for LifecycleStatus[src]

impl Hash for LifecycleStatus[src]

impl PartialEq<LifecycleStatus> for LifecycleStatus[src]

impl StructuralEq for LifecycleStatus[src]

impl StructuralPartialEq for LifecycleStatus[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.