[−][src]Enum nuts::LifecycleStatus
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)
The normal status. Every Activity starts with this status.
Inactive / Sleeping
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]
pub fn clone(&self) -> LifecycleStatus
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for LifecycleStatus
[src]
impl Debug for LifecycleStatus
[src]
impl Eq for LifecycleStatus
[src]
impl Hash for LifecycleStatus
[src]
pub fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<LifecycleStatus> for LifecycleStatus
[src]
pub fn eq(&self, other: &LifecycleStatus) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for LifecycleStatus
[src]
impl StructuralPartialEq for LifecycleStatus
[src]
Auto Trait Implementations
impl RefUnwindSafe for LifecycleStatus
impl Send for LifecycleStatus
impl Sync for LifecycleStatus
impl Unpin for LifecycleStatus
impl UnwindSafe for LifecycleStatus
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,