Skip to main content

default

Function default 

Source
pub fn default(instruction: &Instruction, _: &Layout) -> Result<Option<String>>
Expand description

Default instruction printer which prints the Instruction’s Display representation.

The default printer formats the instruction using its Display implementation and writes it to stdout. The printed string is also returned inside Ok(Some(...)) so callers can record or redisplay it.

§Arguments

  • instruction - The Instruction to print.
  • _ - The active Layout (unused by the default printer).

§Errors

Returns an Err if writing to stdout or other I/O performed by the underlying platform fails.

§Returns

Ok(Some(String)) containing the printed text on success.