pub enum LifecycleState {
Active,
Archived,
SoftDeleted,
HardDeleted,
}Expand description
Lifecycle state of a session.
Allowed transitions:
Active↔Archived,Active→SoftDeleted,Active→HardDeletedArchived→SoftDeleted,Archived→HardDeletedSoftDeleted→Active,SoftDeleted→HardDeletedHardDeletedis terminal
Variants§
Active
Session is live and accepts reads/writes.
Archived
Session is hidden from default listings but remains readable; can be
restored to Active.
SoftDeleted
Session marked for deletion; hidden from listings, reversible via restore.
HardDeleted
Session physically deleted (terminal state); messages and subtree gone.
Implementations§
Source§impl LifecycleState
impl LifecycleState
Sourcepub fn as_str(&self) -> &'static str
pub fn as_str(&self) -> &'static str
Canonical lowercase string representation (DB storage format).
Sourcepub fn from_str_value(s: &str) -> Option<Self>
pub fn from_str_value(s: &str) -> Option<Self>
Parse from lowercase string (returns None for unknown values).
Sourcepub fn can_transition_to(&self, target: &Self) -> bool
pub fn can_transition_to(&self, target: &Self) -> bool
Check whether a transition from self to target is valid per the
session lifecycle state machine.
Trait Implementations§
Source§impl Clone for LifecycleState
impl Clone for LifecycleState
Source§fn clone(&self) -> LifecycleState
fn clone(&self) -> LifecycleState
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 moreimpl Copy for LifecycleState
Source§impl Debug for LifecycleState
impl Debug for LifecycleState
Source§impl<'de> Deserialize<'de> for LifecycleState
impl<'de> Deserialize<'de> for LifecycleState
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for LifecycleState
impl Display for LifecycleState
impl Eq for LifecycleState
Source§impl Hash for LifecycleState
impl Hash for LifecycleState
Source§impl PartialEq for LifecycleState
impl PartialEq for LifecycleState
Source§impl Serialize for LifecycleState
impl Serialize for LifecycleState
impl StructuralPartialEq for LifecycleState
Auto Trait Implementations§
impl Freeze for LifecycleState
impl RefUnwindSafe for LifecycleState
impl Send for LifecycleState
impl Sync for LifecycleState
impl Unpin for LifecycleState
impl UnsafeUnpin for LifecycleState
impl UnwindSafe for LifecycleState
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