pub enum Format {
Prose,
Json,
Lines,
Csv,
Tsv,
}Expand description
Output format for a command.
Prose is the default (per ADR-0003). The other variants map to the
machine-readable formats; their renderers began as Phase 1 stubs (only
diagnostic) and grow per-noun methods with real data (Phase 3 dump,
Phase 4 projects, Phase 5 onward).
Variants§
Prose
Rich human-readable prose output with contextual hints (default).
Json
Newline-delimited JSON (one object per line).
Lines
One identifier per line, for shell pipeline consumption.
Csv
Comma-separated values with a header row.
Tsv
Tab-separated values with a header row.
Implementations§
Source§impl Format
impl Format
Sourcepub fn into_renderer(self) -> Box<dyn Renderer>
pub fn into_renderer(self) -> Box<dyn Renderer>
Construct the renderer for this format, writing to stdout.
Returns a heap-allocated Box<dyn Renderer>. Per-noun methods grow as
real data lands (Phase 3 dump, Phase 4 projects, Phase 5 onward).
Use into_renderer_with_writer in tests to capture output.
Uses TableOptions::default(). Call Format::into_renderer_with_options
to supply user-specified column projection or header-control options.
Sourcepub fn into_renderer_with_options(self, opts: TableOptions) -> Box<dyn Renderer>
pub fn into_renderer_with_options(self, opts: TableOptions) -> Box<dyn Renderer>
Construct the renderer for this format with the given tabular options.
For csv, tsv, and lines, opts controls column projection
(--columns) and header emission (--no-header / --header-only).
For prose and json, opts is ignored — those formats are not column-
structured and do not honour projection or header flags.
Sourcepub fn into_progress_reporter(self) -> Box<dyn ProgressReporter>
pub fn into_progress_reporter(self) -> Box<dyn ProgressReporter>
Construct the progress reporter for this format, writing to stderr.
Format::Json → JsonProgress (NDJSON events on stderr so a JSON
consumer can parse both the final stdout object and the stderr event
stream with the same parser). All other formats → HumanProgress
(prose/lines/csv/tsv share human-readable stderr — stderr is non-data
output so the format distinction does not apply there).
Format is Copy, so a caller can do:
let mut renderer = fmt.into_renderer();
let mut reporter = fmt.into_progress_reporter();Trait Implementations§
impl Copy for Format
impl Eq for Format
impl StructuralPartialEq for Format
Auto Trait Implementations§
impl Freeze for Format
impl RefUnwindSafe for Format
impl Send for Format
impl Sync for Format
impl Unpin for Format
impl UnsafeUnpin for Format
impl UnwindSafe for Format
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.