pub struct PriorityEntry {
pub task_id: String,
pub priority: PriorityLevel,
pub base_priority: PriorityLevel,
pub deadline_secs: u64,
pub submitted_secs: u64,
pub age_count: u32,
/* private fields */
}Expand description
An entry in the priority queue.
Fields§
§task_id: StringTask identifier.
priority: PriorityLevelCurrent effective priority.
base_priority: PriorityLevelOriginal priority before any aging.
deadline_secs: u64Optional deadline (seconds since epoch; 0 = none).
submitted_secs: u64Submission timestamp (seconds since epoch).
age_count: u32Number of times this entry has been aged.
Implementations§
Source§impl PriorityEntry
impl PriorityEntry
Sourcepub fn new(
task_id: impl Into<String>,
priority: PriorityLevel,
submitted_secs: u64,
insertion_order: u64,
) -> Self
pub fn new( task_id: impl Into<String>, priority: PriorityLevel, submitted_secs: u64, insertion_order: u64, ) -> Self
Create a new priority entry.
Sourcepub fn with_deadline(self, deadline_secs: u64) -> Self
pub fn with_deadline(self, deadline_secs: u64) -> Self
Set a deadline.
Sourcepub fn has_deadline(&self) -> bool
pub fn has_deadline(&self) -> bool
Return true if this entry has a deadline.
Sourcepub fn is_overdue(&self, now_secs: u64) -> bool
pub fn is_overdue(&self, now_secs: u64) -> bool
Check whether the deadline has passed relative to now_secs.
Trait Implementations§
Source§impl Clone for PriorityEntry
impl Clone for PriorityEntry
Source§fn clone(&self) -> PriorityEntry
fn clone(&self) -> PriorityEntry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PriorityEntry
impl Debug for PriorityEntry
impl Eq for PriorityEntry
Source§impl Ord for PriorityEntry
impl Ord for PriorityEntry
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for PriorityEntry
impl PartialEq for PriorityEntry
Source§impl PartialOrd for PriorityEntry
impl PartialOrd for PriorityEntry
Auto Trait Implementations§
impl Freeze for PriorityEntry
impl RefUnwindSafe for PriorityEntry
impl Send for PriorityEntry
impl Sync for PriorityEntry
impl Unpin for PriorityEntry
impl UnsafeUnpin for PriorityEntry
impl UnwindSafe for PriorityEntry
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.