pub struct PrinterStatus {
pub online: bool,
pub cover_open: bool,
pub paper_end: bool,
pub paper_near_end: bool,
pub drawer_pin3_high: bool,
}Expand description
The printer’s condition after a print, as both dialects report it.
Read it back from the printer’s own DLE EOT replies with
PrinterStatus::from_dle_eot, so faults and the drawer setting count exactly as they do
for Web Serial.
use hardless_http_dialects::PrinterStatus;
// DLE EOT 1, 2 and 4 replies of a printer that is out of paper.
let status = PrinterStatus::from_dle_eot(0x1A, 0x32, 0x7E);
assert!(status.paper_end && status.paper_near_end && !status.online);Fields§
§online: boolThe printer is online (not stopped by paper end or an open cover).
cover_open: boolThe cover is open.
paper_end: boolThe roll is empty.
paper_near_end: boolThe roll is nearly empty.
drawer_pin3_high: boolThe drawer-kick connector’s pin 3 (the drawer sensor) reads high.
Implementations§
Source§impl PrinterStatus
impl PrinterStatus
Sourcepub fn from_dle_eot(printer: u8, offline_cause: u8, paper: u8) -> Self
pub fn from_dle_eot(printer: u8, offline_cause: u8, paper: u8) -> Self
From the replies to DLE EOT 1 (printer), DLE EOT 2 (offline cause) and DLE EOT 4
(paper sensor), as defined in the ESC/POS command reference.
Trait Implementations§
Source§impl Clone for PrinterStatus
impl Clone for PrinterStatus
impl Copy for PrinterStatus
Source§impl Debug for PrinterStatus
impl Debug for PrinterStatus
Source§impl Default for PrinterStatus
impl Default for PrinterStatus
impl Eq for PrinterStatus
Source§impl PartialEq for PrinterStatus
impl PartialEq for PrinterStatus
impl StructuralPartialEq for PrinterStatus
Auto Trait Implementations§
impl Freeze for PrinterStatus
impl RefUnwindSafe for PrinterStatus
impl Send for PrinterStatus
impl Sync for PrinterStatus
impl Unpin for PrinterStatus
impl UnsafeUnpin for PrinterStatus
impl UnwindSafe for PrinterStatus
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