pub struct QueueEntry {
pub command: PrioritizedCommand,
pub enqueued_at: Instant,
pub deadline: Option<Instant>,
pub retry_attempt: u32,
pub sequence: u64,
}Expand description
Entry in the priority queue
Fields§
§command: PrioritizedCommandThe prioritized command
enqueued_at: InstantWhen the command was enqueued
deadline: Option<Instant>Deadline instant (if set)
retry_attempt: u32Current retry attempt (0-based)
sequence: u64Sequence number for FIFO within same priority
Implementations§
Source§impl QueueEntry
impl QueueEntry
Sourcepub fn new(command: PrioritizedCommand, sequence: u64) -> Self
pub fn new(command: PrioritizedCommand, sequence: u64) -> Self
Create a new queue entry
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Check if the command has expired
Sourcepub fn time_until_deadline(&self) -> Option<Duration>
pub fn time_until_deadline(&self) -> Option<Duration>
Get time until deadline (if set)
Sourcepub fn next_retry_delay(&self) -> Option<Duration>
pub fn next_retry_delay(&self) -> Option<Duration>
Calculate next retry delay
Sourcepub fn increment_retry(&mut self)
pub fn increment_retry(&mut self)
Increment retry attempt
Sourcepub fn should_retry(&self) -> bool
pub fn should_retry(&self) -> bool
Check if should retry
Trait Implementations§
Source§impl Debug for QueueEntry
impl Debug for QueueEntry
Source§impl Ord for QueueEntry
impl Ord for QueueEntry
Source§impl PartialEq for QueueEntry
impl PartialEq for QueueEntry
Source§impl PartialOrd for QueueEntry
impl PartialOrd for QueueEntry
impl Eq for QueueEntry
Auto Trait Implementations§
impl Freeze for QueueEntry
impl RefUnwindSafe for QueueEntry
impl Send for QueueEntry
impl Sync for QueueEntry
impl Unpin for QueueEntry
impl UnsafeUnpin for QueueEntry
impl UnwindSafe for QueueEntry
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
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.