pub struct JobRegistry { /* private fields */ }Expand description
Shared job registry. Cheap to clone.
Implementations§
Source§impl JobRegistry
impl JobRegistry
Sourcepub fn create(&self, printer_name: String) -> JobRecord
pub fn create(&self, printer_name: String) -> JobRecord
Allocate a new pending job for printer_name. Returns a clone of the
record so the caller can stash the JobId and cancel_flag without
holding the registry lock.
Sourcepub fn get(&self, id: JobId) -> Option<JobRecord>
pub fn get(&self, id: JobId) -> Option<JobRecord>
Look up a job by id. Returns a clone so the caller doesn’t hold the lock.
Sourcepub fn jobs_for_printer(&self, printer_name: &str) -> Vec<JobRecord>
pub fn jobs_for_printer(&self, printer_name: &str) -> Vec<JobRecord>
All jobs that target the named printer. Order is allocation order.
Sourcepub fn set_state(&self, id: JobId, state: JobState)
pub fn set_state(&self, id: JobId, state: JobState)
Force a job into state. Stamps completed_at when crossing into a
terminal state. No-op if the id doesn’t exist.
Sourcepub fn set_failure(&self, id: JobId, reasons: PrinterReason, message: String)
pub fn set_failure(&self, id: JobId, reasons: PrinterReason, message: String)
Mark a job as failed with IPP reasons + message.
Trait Implementations§
Source§impl Clone for JobRegistry
impl Clone for JobRegistry
Source§fn clone(&self) -> JobRegistry
fn clone(&self) -> JobRegistry
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 moreAuto Trait Implementations§
impl Freeze for JobRegistry
impl !RefUnwindSafe for JobRegistry
impl Send for JobRegistry
impl Sync for JobRegistry
impl Unpin for JobRegistry
impl UnsafeUnpin for JobRegistry
impl !UnwindSafe for JobRegistry
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