pub struct PrinterInfo {Show 14 fields
pub name: String,
pub description: String,
pub driver: String,
pub port: String,
pub connection: PrinterConnection,
pub status: PrinterStatus,
pub printer_type: PrinterType,
pub is_default: Option<bool>,
pub accepting_jobs: Option<bool>,
pub shared: Option<bool>,
pub color: Option<bool>,
pub duplex: Option<bool>,
pub jobs_in_queue: Option<u32>,
pub location: String,
}Expand description
Information about a single printer
Fields§
§name: StringPrinter name
description: StringPrinter description or model
driver: StringDriver name
port: StringPort or URI (e.g., “usb://…”, “ipp://…”)
connection: PrinterConnectionConnection type
status: PrinterStatusCurrent status
printer_type: PrinterTypePrinter type
is_default: Option<bool>Whether this is the default printer, or None where the default could not be
read. A failed lpstat -d used to make every queue read as not default.
accepting_jobs: Option<bool>Whether the printer accepts new jobs.
None on Windows. CUPS reports it directly – lpstat -a says
“accepting requests” or “not accepting requests” – and Win32_Printer
has no equivalent property. It used to be filled there with
status != PrinterStatus::Offline, which is the one derivation the
entity’s own description rules out: “distinct from status: a stopped
queue may still accept jobs and hold them, which is the difference
between a delayed print and a rejected one”.
Whether the printer is shared over the network. None where it was not
read: the CUPS path used to write a literal false for every queue.
color: Option<bool>Whether the printer supports colour. None when the platform said
nothing about it, which is not the same as a monochrome printer.
This was a bool filled from a Color property that Win32_Printer
does not have. It came back null for every printer, unwrap_or(false)
made it monochrome, and system.printer.{n}.color published that as a
measurement on every Windows machine. Three of the four printers on the
machine that found it do support colour.
duplex: Option<bool>Whether the printer supports duplex (double-sided). None on every
path: no reader queries it. This was a literal false for every
printer, which read as a simplex-only device.
jobs_in_queue: Option<u32>Number of jobs in queue. None on both platforms: no live count is
read here. This was a literal 0 on every printer, which read as an
empty queue. On Windows the query selected JobCountSinceLastReset, a
counter since the spooler last reset rather than the queue depth, and
ignored it.
location: StringLocation string (if configured)
Trait Implementations§
Source§impl Clone for PrinterInfo
impl Clone for PrinterInfo
Source§impl Debug for PrinterInfo
impl Debug for PrinterInfo
Source§impl<'de> Deserialize<'de> for PrinterInfo
impl<'de> Deserialize<'de> for PrinterInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for PrinterInfo
impl RefUnwindSafe for PrinterInfo
impl Send for PrinterInfo
impl Sync for PrinterInfo
impl Unpin for PrinterInfo
impl UnsafeUnpin for PrinterInfo
impl UnwindSafe for PrinterInfo
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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