pub struct OutputMeta<'a> {
pub name: &'a str,
pub media_type: Option<&'a str>,
pub framing: Framing,
pub help: Option<&'a str>,
pub default: bool,
pub hide: bool,
pub select: Option<&'a str>,
pub schema: Option<&'a str>,
pub schema_fn: Option<fn() -> String>,
}Expand description
One thing a command can write.
Fields§
§name: &'a strThe token a user types for it.
media_type: Option<&'a str>The media type of the bytes, independent of their stream framing.
framing: Framing§help: Option<&'a str>§default: boolWhat the command writes when nothing selects otherwise.
hide: boolRemove an inherited output of the same name.
select: Option<&'a str>A boolean flag whose presence picks this output, for the --json spelling.
schema: Option<&'a str>A JSON Schema written into the table as text.
What a hand-written table or an include_str!ed file uses. A derive that lowers a
Rust type uses Self::schema_fn instead, because schema_for! is a call.
schema_fn: Option<fn() -> String>A JSON Schema produced on demand.
A fn pointer for the same reason Completer is one: this lives in a
&'static table that a const expression initializes, and a schema derived from a
Rust type is a runtime call. Preferred over Self::schema when both are set.
Implementations§
Source§impl OutputMeta<'_>
impl OutputMeta<'_>
Sourcepub const EMPTY: OutputMeta<'static>
pub const EMPTY: OutputMeta<'static>
A named output with nothing else said about it, for struct-update syntax.
Sourcepub fn schema_text(&self) -> Option<String>
pub fn schema_text(&self) -> Option<String>
The schema, whichever way it was declared.
Trait Implementations§
Source§impl<'a> Clone for OutputMeta<'a>
impl<'a> Clone for OutputMeta<'a>
Source§fn clone(&self) -> OutputMeta<'a>
fn clone(&self) -> OutputMeta<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more