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

    fn motor_on(&mut self) { ... }
    fn motor_off(&mut self) { ... }
}
Expand description

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§

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.

Provided Methods§

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

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

Implementors§