Skip to main content

mlua_luau_scheduler/
status.rs

1#![allow(clippy::module_name_repetitions)]
2
3/**
4    The current status of a scheduler.
5*/
6#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
7pub enum Status {
8    /// The scheduler has not yet started running.
9    NotStarted,
10    /// The scheduler is currently running.
11    Running,
12    /// The scheduler has completed.
13    Completed,
14}
15
16impl Status {
17    #[must_use]
18    pub const fn is_not_started(self) -> bool {
19        matches!(self, Self::NotStarted)
20    }
21
22    #[must_use]
23    pub const fn is_running(self) -> bool {
24        matches!(self, Self::Running)
25    }
26
27    #[must_use]
28    pub const fn is_completed(self) -> bool {
29        matches!(self, Self::Completed)
30    }
31}