[][src]Trait spectrusty::peripherals::bus::zxprinter::Spooler

pub trait Spooler: Default + Debug {
    pub fn push_line(&mut self, line: &[u8]);

    pub fn motor_on(&mut self) { ... }
pub fn motor_off(&mut self) { ... } }

An interface to the ZX Printer spooler.

An implementation of this trait must be provided in order to complete the emulation of ZxPrinterDevice.

Both Debug and Default traits also need to be implemented.

Required methods

pub fn push_line(&mut self, line: &[u8])[src]

After each printed line this method is being called with a reference to a slice containing information about up to 256 printed dots stored in up to 32 bytes.

8 dots are encoded from the most significant to the least significant bit in each byte. So the leftmost dot is encoded in the bit 7 of the first byte in a given slice and the rightmost dot is encoded in the bit 0 of the last byte.

A value of 1 in each bit signifies the presence of a dot, 0 means there is no dot.

A received slice will never be larger than 32 bytes. If a user presses a BREAK key during COPY, the slice may be smaller than 32 bytes but it will never be empty.

Loading content...

Provided methods

pub fn motor_on(&mut self)[src]

Can be implemented to get the notification that the printing will begin shortly.

pub fn motor_off(&mut self)[src]

Can be implemented to get the notification that the printing has ended.

Loading content...

Implementors

impl Spooler for DebugSpooler[src]

Loading content...