pub trait Printer {
    type W: Write;
    type M: InterruptModer;

    // Required method
    fn destination(&mut self) -> &mut Self::W;

    // Provided methods
    fn print(&mut self, args: Arguments<'_>) { ... }
    fn println(&mut self, args: Arguments<'_>) { ... }
}
Expand description

Generic Printer trait

Required Associated Types§

source

type W: Write

Writer type

source

type M: InterruptModer

Interrupt type

Required Methods§

source

fn destination(&mut self) -> &mut Self::W

Returns destination writer.

Used by print and println default impls

Provided Methods§

source

fn print(&mut self, args: Arguments<'_>)

Prints formatted output to destination

source

fn println(&mut self, args: Arguments<'_>)

Prints formatted output to destination with newline

Implementors§

source§

impl Printer for Dummy

§

type W = Dummy

§

type M = InterruptFree

source§

impl Printer for ItmAssumeSync

§

type W = Itm

§

type M = InterruptOk

source§

impl<Mode: InterruptModer> Printer for Itm<Mode>

§

type W = Itm

§

type M = Mode

source§

impl<Mode: InterruptModer> Printer for ItmSync<Mode>

§

type W = Itm

§

type M = Mode

source§

impl<Mode: InterruptModer, T: SemihostingComp> Printer for Semihosting<Mode, T>

§

type W = T

§

type M = Mode

source§

impl<W: Write> Printer for GenericPrinter<W>

§

type W = W

§

type M = InterruptFree