Shortcuts

This commit is contained in:
Gregor Reitzenstein 2020-12-02 13:36:14 +01:00
parent 8e3b8834c0
commit fc1aea2f96

View File

@ -79,6 +79,14 @@ impl MachineState {
Self { state: Status::Free } Self { state: Status::Free }
} }
pub fn free() -> Self {
Self { state: Status::Free }
}
pub fn used(uid: UserId, priority: Priority) -> Self {
Self { state: Status::InUse(uid, priority) }
}
/// Check if the given priority is higher than one's own. /// Check if the given priority is higher than one's own.
/// ///
/// If `self` does not have a priority then this function always returns `true` /// If `self` does not have a priority then this function always returns `true`