pub struct CommandOutput { /* private fields */ }Expand description
A command’s renderable result: a typed CliArtifact plus terminal-only
presentation state (an optional section title and a render-suppression
flag).
The artifact is the single source of truth on the wire; title and
skip_render only affect interactive terminal rendering.
Implementations§
Source§impl CommandOutput
impl CommandOutput
pub const fn new(artifact: CliArtifact) -> Self
pub const fn artifact(&self) -> &CliArtifact
pub fn into_artifact(self) -> CliArtifact
pub const fn should_skip_render(&self) -> bool
pub const fn with_skip_render(self) -> Self
pub fn with_title(self, title: impl Into<String>) -> Self
pub fn title(&self) -> Option<&str>
pub fn text(content: impl Into<String>) -> Self
pub fn text_titled(title: impl Into<String>, content: impl Into<String>) -> Self
pub fn copy_paste(content: impl Into<String>) -> Self
pub fn copy_paste_titled( title: impl Into<String>, content: impl Into<String>, ) -> Self
pub fn table(columns: Vec<impl Into<String>>, rows: Vec<JsonValue>) -> Self
Sourcepub fn table_of<T: Serialize>(
columns: Vec<impl Into<String>>,
items: &[T],
) -> Self
pub fn table_of<T: Serialize>( columns: Vec<impl Into<String>>, items: &[T], ) -> Self
Build a table by serializing each row item to a JSON object. columns
names the fields to display; the renderer reads them off each object.
pub const fn table_artifact(artifact: TableArtifact) -> Self
pub fn list(items: Vec<ListItem>) -> Self
pub const fn card(card: PresentationCardArtifact) -> Self
Sourcepub fn card_value(title: impl Into<String>, value: &impl Serialize) -> Self
pub fn card_value(title: impl Into<String>, value: &impl Serialize) -> Self
Build a presentation card whose sections are the top-level fields of a
serializable value (one CardSection per field). Deterministic
producer-side mapping — the wire carries a concrete card.
pub const fn chart(chart: ChartArtifact) -> Self
pub const fn dashboard(dashboard: DashboardArtifact) -> Self
Trait Implementations§
Source§impl Clone for CommandOutput
impl Clone for CommandOutput
Source§fn clone(&self) -> CommandOutput
fn clone(&self) -> CommandOutput
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CommandOutput
impl Debug for CommandOutput
Source§impl From<CliArtifact> for CommandOutput
impl From<CliArtifact> for CommandOutput
Source§fn from(artifact: CliArtifact) -> Self
fn from(artifact: CliArtifact) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for CommandOutput
impl RefUnwindSafe for CommandOutput
impl Send for CommandOutput
impl Sync for CommandOutput
impl Unpin for CommandOutput
impl UnsafeUnpin for CommandOutput
impl UnwindSafe for CommandOutput
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more