mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 20:43:41 +00:00
fix: add a default always to the get status chore: Only do updates when the thing is installed. chore: Make the thing buildable for testing chore: Add in the debugging chore: Remove the bluj tracing chore: Fix the build Chore: Make these fn's instead of allways ran. chore: Fix the testing fix: The stopping/ restarting service fix: Fix the restarting.
29 lines
765 B
Rust
29 lines
765 B
Rust
use helpers::NonDetachingJoinHandle;
|
|
|
|
pub(crate) enum TransitionState {
|
|
BackingUp(NonDetachingJoinHandle<()>),
|
|
Restarting(NonDetachingJoinHandle<()>),
|
|
Configuring(NonDetachingJoinHandle<()>),
|
|
None,
|
|
}
|
|
|
|
impl TransitionState {
|
|
pub(crate) fn join_handle(&self) -> Option<&NonDetachingJoinHandle<()>> {
|
|
Some(match self {
|
|
TransitionState::BackingUp(a) => a,
|
|
TransitionState::Restarting(a) => a,
|
|
TransitionState::Configuring(a) => a,
|
|
TransitionState::None => return None,
|
|
})
|
|
}
|
|
pub(crate) fn abort(&self) {
|
|
self.join_handle().map(|transition| transition.abort());
|
|
}
|
|
}
|
|
|
|
impl Default for TransitionState {
|
|
fn default() -> Self {
|
|
TransitionState::None
|
|
}
|
|
}
|