Skip to main content

Module format

Module format 

Source
Expand description

The output representation: pretty for people, or json for machines.

OutputFormat parses from those two lowercase names, and Display prints them back. With the cli feature it is a Clap value enum, so OutputArgs parses --format into it.

use ctl_core::format::OutputFormat;

assert_eq!("json".parse::<OutputFormat>(), Ok(OutputFormat::Json));
assert!(OutputFormat::Json.is_json());
assert_eq!(OutputFormat::default(), OutputFormat::Pretty);

Structs§

ParseFormatError
The error OutputFormat’s FromStr returns for text that is not pretty or json. Display prints expected pretty or json.

Enums§

OutputFormat
The output representation a view writes a result in.