pub struct PrinterConfig {
pub name: String,
pub driver_name: String,
pub make_and_model: String,
pub device_id: String,
pub device_uri: String,
pub dpi: i32,
pub printhead_width_dots: u32,
pub media_names: Vec<String>,
pub media_sizes: Vec<[i32; 2]>,
pub darkness: i32,
}Expand description
Static printer capabilities supplied by the consumer crate (typically
loaded from a config file). Carries everything the framework needs to
build the IPP Get-Printer-Attributes response.
Fields§
§name: String§driver_name: String§make_and_model: String§device_id: String§device_uri: String§dpi: i32§printhead_width_dots: u32§media_names: Vec<String>§media_sizes: Vec<[i32; 2]>§darkness: i32Darkness 0–100 (maps to print density).
Implementations§
Source§impl PrinterConfig
impl PrinterConfig
Sourcepub fn printer_uri(&self, host: &str, port: u16) -> String
pub fn printer_uri(&self, host: &str, port: u16) -> String
Build the canonical ipp://<host>:<port>/ipp/print/<name> URI. If
host is unspecified (0.0.0.0, ::, empty), advertises
localhost so CUPS and mDNS clients get a reachable address.
Trait Implementations§
Source§impl Clone for PrinterConfig
impl Clone for PrinterConfig
Source§fn clone(&self) -> PrinterConfig
fn clone(&self) -> PrinterConfig
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 moreSource§impl Debug for PrinterConfig
impl Debug for PrinterConfig
Source§impl<'de> Deserialize<'de> for PrinterConfig
impl<'de> Deserialize<'de> for PrinterConfig
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PrinterConfig
impl RefUnwindSafe for PrinterConfig
impl Send for PrinterConfig
impl Sync for PrinterConfig
impl Unpin for PrinterConfig
impl UnsafeUnpin for PrinterConfig
impl UnwindSafe for PrinterConfig
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