Something went wrong. Try again.
[AWIP] Local-first peer-to-peer connectivity and sharing across Android, Linux and Windows, made with Tauri
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556use std::fmt::{Display, Formatter};
#[derive(Clone, Copy, Debug, PartialEq, Eq)]pub enum LifecycleState { Created, LoadingIdentity, LoadingStore, StartingPlatform, StartingDiscovery, Ready, ShuttingDown, Stopped,}
impl LifecycleState { pub fn can_transition(self, next: Self) -> bool { matches!( (self, next), (Self::Created, Self::LoadingIdentity | Self::ShuttingDown) | ( Self::LoadingIdentity, Self::LoadingStore | Self::ShuttingDown ) | ( Self::LoadingStore, Self::StartingPlatform | Self::ShuttingDown ) | ( Self::StartingPlatform, Self::StartingDiscovery | Self::ShuttingDown ) | (Self::StartingDiscovery, Self::Ready | Self::ShuttingDown) | (Self::Ready, Self::ShuttingDown) | (Self::ShuttingDown, Self::Stopped) ) }}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]pub struct InvalidTransition { pub from: LifecycleState, pub to: LifecycleState,}
impl Display for InvalidTransition { fn fmt(&self, formatter: &mut Formatter<'_>) -> std::fmt::Result { write!( formatter, "invalid application lifecycle transition: {:?} -> {:?}", self.from, self.to ) }}
impl std::error::Error for InvalidTransition {}