pub struct PrintSpooler { /* private fields */ }Expand description
Central print spooler managing multiple printer queues.
Implementations§
Source§impl PrintSpooler
impl PrintSpooler
Sourcepub fn add_printer(&mut self, config: PrinterConfig)
pub fn add_printer(&mut self, config: PrinterConfig)
Add a printer to the spooler.
Sourcepub fn remove_printer(&mut self, name: &str) -> bool
pub fn remove_printer(&mut self, name: &str) -> bool
Remove a printer by name.
Sourcepub fn submit_job(
&mut self,
printer: Option<&str>,
document_name: &str,
data: Vec<u8>,
) -> Option<PrintJobId>
pub fn submit_job( &mut self, printer: Option<&str>, document_name: &str, data: Vec<u8>, ) -> Option<PrintJobId>
Submit a job to a specific printer (or the default).
Sourcepub fn cancel_job(&mut self, printer: &str, job_id: PrintJobId) -> bool
pub fn cancel_job(&mut self, printer: &str, job_id: PrintJobId) -> bool
Cancel a job.
Sourcepub fn printer_count(&self) -> usize
pub fn printer_count(&self) -> usize
Get the number of printers.
Sourcepub fn default_printer(&self) -> Option<&str>
pub fn default_printer(&self) -> Option<&str>
Get the default printer name.
Sourcepub fn get_printer(&self, name: &str) -> Option<&PrinterConfig>
pub fn get_printer(&self, name: &str) -> Option<&PrinterConfig>
Get a printer configuration by name.