pub struct Printer { /* private fields */ }Expand description
The printer object represents the thermal printer.
Implementations§
Source§impl Printer
impl Printer
Sourcepub fn new(vendor_id: u16, product_id: u16) -> Result<Option<Printer>, Error>
pub fn new(vendor_id: u16, product_id: u16) -> Result<Option<Printer>, Error>
Creates the printer with the given VID/PID
use escpos_rw::{Error, Printer};
let Some(printer) = Printer::new(0x04b8, 0x0202)? else {
return Err(escpos_rw::Error::PrinterError(
"No printer found !".to_string(),
));
};Auto Trait Implementations§
impl !Freeze for Printer
impl RefUnwindSafe for Printer
impl Send for Printer
impl Sync for Printer
impl Unpin for Printer
impl UnwindSafe for Printer
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