pub struct DedupQueue { /* private fields */ }Expand description
Priority queue for dedup tasks.
Implementations§
Source§impl DedupQueue
impl DedupQueue
Sourcepub fn enqueue(
&mut self,
priority: DedupPriority,
kind: DedupTaskKind,
target: String,
) -> u64
pub fn enqueue( &mut self, priority: DedupPriority, kind: DedupTaskKind, target: String, ) -> u64
Enqueue a task, returning the assigned ID.
Sourcepub fn enqueue_task(&mut self, task: DedupTask)
pub fn enqueue_task(&mut self, task: DedupTask)
Enqueue a pre-built task.
Sourcepub fn peek(&self) -> Option<&DedupTask>
pub fn peek(&self) -> Option<&DedupTask>
Peek at the highest-priority task without removing it.
Sourcepub fn record_completed(&mut self)
pub fn record_completed(&mut self)
Record a task completion.
Sourcepub fn record_failed(&mut self)
pub fn record_failed(&mut self)
Record a task failure.
Sourcepub fn stats(&self) -> QueueStats
pub fn stats(&self) -> QueueStats
Get queue statistics.
Sourcepub fn drain_batch(&mut self, n: usize) -> Vec<DedupTask>
pub fn drain_batch(&mut self, n: usize) -> Vec<DedupTask>
Drain up to n tasks from the queue.
Trait Implementations§
Source§impl Debug for DedupQueue
impl Debug for DedupQueue
Auto Trait Implementations§
impl Freeze for DedupQueue
impl RefUnwindSafe for DedupQueue
impl Send for DedupQueue
impl Sync for DedupQueue
impl Unpin for DedupQueue
impl UnsafeUnpin for DedupQueue
impl UnwindSafe for DedupQueue
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more