pub struct JobContext {
pub id: JobId,
pub printer_name: String,
pub cancel_flag: Arc<AtomicBool>,
pub document_format: String,
pub print_quality: Option<u8>,
}Expand description
Context passed to a print-job worker so it can observe cancellation and report progress without re-querying the registry.
Fields§
§id: JobId§printer_name: String§cancel_flag: Arc<AtomicBool>§document_format: StringThe document-format the client sent (RFC 8011), e.g.
image/pwg-raster or image/jpeg. Defaults to
application/octet-stream when the client omits it. The print
callback branches on this to pick a decoder.
print_quality: Option<u8>print-quality (RFC 8011: 3 draft, 4 normal, 5 high), when the client
sent it. CUPS derives it from the cupsPrintQuality PPD choice, so on
a driverless queue this is the one per-job quality knob that reaches a
driver — the generated PPD maps quality only to HWResolution, which
collapses to a single value on a fixed-resolution printer, leaving the
raster identical for all three.
Implementations§
Source§impl JobContext
impl JobContext
Sourcepub fn is_canceled(&self) -> bool
pub fn is_canceled(&self) -> bool
True once the client has canceled this job. A print callback that loops (e.g. waiting on hardware) should poll this and bail promptly.
Trait Implementations§
Source§impl Clone for JobContext
impl Clone for JobContext
Source§fn clone(&self) -> JobContext
fn clone(&self) -> JobContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more