pub struct Priority(/* private fields */);Expand description
Represents the priority of an enqueued rebuild job. The job queue is sorted based on priority and time, so the lower this number is, the more prioritized the job is. It’s a little backwards, but hey.
There are some utility functions on the type for accessing default values for well-defined use cases. These map to constants in the same namespace as this type, and you can use either one.
use rebuilderd_common::api::v1::Priority;
assert_eq!(Priority::from(1), Priority::default());
assert_eq!(Priority::from(2), Priority::retry());
assert_eq!(Priority::from(0), Priority::manual());You can also set a completely custom priority. This is mostly useful for external API calls that orchestrate rebuilds.
use rebuilderd_common::api::v1::Priority;
let custom = Priority::from(10);
assert_eq!(custom, Priority::from(10));
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Priority
impl<'de> Deserialize<'de> for Priority
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 Priority
impl Eq for Priority
impl StructuralPartialEq for Priority
Auto Trait Implementations§
impl Freeze for Priority
impl RefUnwindSafe for Priority
impl Send for Priority
impl Sync for Priority
impl Unpin for Priority
impl UnsafeUnpin for Priority
impl UnwindSafe for Priority
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