pub struct PrintQueue { /* private fields */ }Expand description
A queue of print jobs for a single printer.
Implementations§
Source§impl PrintQueue
impl PrintQueue
Sourcepub fn enqueue(&mut self, job: PrintJob) -> bool
pub fn enqueue(&mut self, job: PrintJob) -> bool
Enqueue a job. Returns false if the queue is full.
Sourcepub fn cancel(&mut self, job_id: PrintJobId) -> bool
pub fn cancel(&mut self, job_id: PrintJobId) -> bool
Cancel a job by ID. Returns true if found and cancelled.
Sourcepub fn get_status(&self, job_id: PrintJobId) -> Option<PrintJobStatus>
pub fn get_status(&self, job_id: PrintJobId) -> Option<PrintJobStatus>
Get the status of a specific job.
Sourcepub fn pending_count(&self) -> usize
pub fn pending_count(&self) -> usize
Number of jobs currently in the queue.
Sourcepub fn total_count(&self) -> usize
pub fn total_count(&self) -> usize
Total number of jobs in the queue (all statuses).
Sourcepub fn complete_job(&mut self, job_id: PrintJobId) -> bool
pub fn complete_job(&mut self, job_id: PrintJobId) -> bool
Mark a job as completed and update stats.
Sourcepub fn purge_finished(&mut self)
pub fn purge_finished(&mut self)
Remove completed and cancelled jobs from the queue.