pub enum ShiftType {
Morning,
Afternoon,
Rest,
Night,
Study,
}Expand description
The five shift types in a standard Chinese rotating shift system.
§Variants
| Variant | Label | Full Label | Category |
|---|---|---|---|
Morning | 早 | 早班 | Work |
Afternoon | 中 | 中班 | Work |
Rest | 休 | 休班 | Rest |
Night | 夜 | 夜班 | Work |
Study | 学 | 学习班 | Rest |
§Example
use shift_algorithm::ShiftType;
assert!(ShiftType::Morning.is_work());
assert!(!ShiftType::Rest.is_work());
assert!(ShiftType::Rest.is_rest());
assert!(ShiftType::Study.is_rest());Variants§
Morning
早班 — morning shift
Afternoon
中班 — afternoon shift
Rest
休班 — rest day
Night
夜班 — night shift
Study
学习班 — study/training day (counts as rest for scheduling purposes)
Implementations§
Source§impl ShiftType
impl ShiftType
Sourcepub fn full_label(&self) -> &'static str
pub fn full_label(&self) -> &'static str
Full Chinese label.
Sourcepub fn label_en_padded(&self) -> &'static str
pub fn label_en_padded(&self) -> &'static str
Padded English label (3 chars for alignment).
Sourcepub fn full_label_en(&self) -> &'static str
pub fn full_label_en(&self) -> &'static str
Full English label.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ShiftType
impl<'de> Deserialize<'de> for ShiftType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for ShiftType
impl Eq for ShiftType
impl StructuralPartialEq for ShiftType
Auto Trait Implementations§
impl Freeze for ShiftType
impl RefUnwindSafe for ShiftType
impl Send for ShiftType
impl Sync for ShiftType
impl Unpin for ShiftType
impl UnsafeUnpin for ShiftType
impl UnwindSafe for ShiftType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more