pub struct CommandResult {
pub data: Value,
pub metadata: CommandResultMetadata,
}Expand description
Data returned by a command handler.
Command handlers should return renderable data and keep output metadata on
CommandSpec. The metadata field is reserved for future command-result
extensions that are not known when the command is registered.
Fields§
§data: ValueJSON data rendered by the configured output formatter.
metadata: CommandResultMetadataOptional command-result extension metadata.
Implementations§
Source§impl CommandResult
impl CommandResult
Sourcepub fn with_next_actions(self, actions: Vec<NextAction>) -> Self
pub fn with_next_actions(self, actions: Vec<NextAction>) -> Self
Attaches suggested follow-up actions to this result.
Trait Implementations§
Source§impl Clone for CommandResult
impl Clone for CommandResult
Source§fn clone(&self) -> CommandResult
fn clone(&self) -> CommandResult
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 CommandResult
impl Debug for CommandResult
Source§impl From<Value> for CommandResult
impl From<Value> for CommandResult
Source§impl PartialEq for CommandResult
impl PartialEq for CommandResult
Source§fn eq(&self, other: &CommandResult) -> bool
fn eq(&self, other: &CommandResult) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CommandResult
Auto Trait Implementations§
impl Freeze for CommandResult
impl RefUnwindSafe for CommandResult
impl Send for CommandResult
impl Sync for CommandResult
impl Unpin for CommandResult
impl UnsafeUnpin for CommandResult
impl UnwindSafe for CommandResult
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
Mutably borrows from an owned value. Read more