mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-02 05:23:14 +00:00
* feat: Implementation on the backup for the service. * wip: Getting the flow of backup/restore * feat: Recover * Feature: Commit the full pass on the backup restore. * use special type for backup instead of special id (#2614) * fix: Allow compat docker style to run again * fix: Backup for the js side * chore: Update some of the callbacks --------- Co-authored-by: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com>
34 lines
975 B
Rust
34 lines
975 B
Rust
use crate::status::MainStatus;
|
|
|
|
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
|
pub enum StartStop {
|
|
Start,
|
|
Stop,
|
|
}
|
|
|
|
impl StartStop {
|
|
pub(crate) fn is_start(&self) -> bool {
|
|
matches!(self, StartStop::Start)
|
|
}
|
|
}
|
|
impl From<MainStatus> for StartStop {
|
|
fn from(value: MainStatus) -> Self {
|
|
match value {
|
|
MainStatus::Stopped => StartStop::Stop,
|
|
MainStatus::Restoring => StartStop::Stop,
|
|
MainStatus::Restarting => StartStop::Start,
|
|
MainStatus::Stopping { .. } => StartStop::Stop,
|
|
MainStatus::Starting => StartStop::Start,
|
|
MainStatus::Running {
|
|
started: _,
|
|
health: _,
|
|
} => StartStop::Start,
|
|
MainStatus::BackingUp { started, health: _ } if started.is_some() => StartStop::Start,
|
|
MainStatus::BackingUp {
|
|
started: _,
|
|
health: _,
|
|
} => StartStop::Stop,
|
|
}
|
|
}
|
|
}
|