use serde::Deserialize;
#[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd, Ord, Deserialize)]
#[serde(transparent)]
pub struct GroupPriority(pub i8);
impl GroupPriority {
pub const DEFAULT: Self = Self(2);
pub const OFF: Self = Self(-1);
pub const ABOVE_DEFAULT: Self = Self(3);
pub const FALLBACK: Self = Self(0);
pub const UNPLANNED: Self = Self(-1);
pub const OUT_OF_THE_ROUND: i8 = -1;
pub fn get(self) -> i8 {
self.0
}
}
impl Default for GroupPriority {
fn default() -> Self {
Self::DEFAULT
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn the_fallback_sits_under_the_groups_and_inside_the_autotune() {
assert!(GroupPriority::FALLBACK < GroupPriority::DEFAULT);
assert!(GroupPriority::FALLBACK.get() >= 0);
assert!(GroupPriority::UNPLANNED.get() < 0);
}
}