mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-01 21:13:09 +00:00
* rename frontend to web and update contributing guide * rename this time * fix build * restructure rust code * update documentation * update descriptions * Update CONTRIBUTING.md Co-authored-by: J H <2364004+Blu-J@users.noreply.github.com> --------- Co-authored-by: Aiden McClelland <me@drbonez.dev> Co-authored-by: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com> Co-authored-by: J H <2364004+Blu-J@users.noreply.github.com>
33 lines
914 B
Rust
33 lines
914 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::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,
|
|
}
|
|
}
|
|
}
|