use p101_is::Register;
use rust_decimal::Decimal;
use crate::message::PrintPayload;

/// The trait defines common aspects of a printer device.
/// It defines:
/// - two function for writing text to whatever output media
/// - a function to get printer's name
pub trait PrinterProvider {
    fn get_name(&self) -> &str;

    /// Prints the decimal value in the value column, right padded.
    fn print_value(&mut self, value: Decimal);

    /// Prints the register name in the register column.
    fn print_register(&mut self, register: Register);

    /// Prints a entire line that can be:
    /// - a value, register and operator
    /// - or an address and an instruction.
    fn print(&mut self, payload: PrintPayload);

    /// Advance the "paper" to a new line.
    fn newline(&mut self);
}
