pub struct CommandResult {
pub status: String,
pub command: String,
pub data: Option<Value>,
pub message: Option<String>,
pub code: Option<String>,
pub errors: Vec<String>,
pub warnings: Vec<String>,
}Expand description
Result of a CLI command execution
Fields§
§status: StringStatus of the command: “success”, “error”, “validation-failed”
command: StringName of the command that was executed
data: Option<Value>Primary data/output from the command
message: Option<String>Error message (if status is “error”)
code: Option<String>Error code (if status is “error”)
errors: Vec<String>Validation errors (if status is “validation-failed”)
warnings: Vec<String>Warnings that occurred during execution
Implementations§
Source§impl CommandResult
impl CommandResult
Sourcepub fn success(command: &str, data: Value) -> Self
pub fn success(command: &str, data: Value) -> Self
Create a successful command result with data
Sourcepub fn success_with_warnings(
command: &str,
data: Value,
warnings: Vec<String>,
) -> Self
pub fn success_with_warnings( command: &str, data: Value, warnings: Vec<String>, ) -> Self
Create a successful command result with warnings
Sourcepub fn validation_failed(command: &str, errors: Vec<String>, code: &str) -> Self
pub fn validation_failed(command: &str, errors: Vec<String>, code: &str) -> Self
Create a validation-failure result.
Use this when the command ran successfully but the artifact it checked
failed its gate (e.g. a lint quality gate or a federation composition
check). The runner maps this status to exit code 2 — distinct from
operational errors (exit 1). See crate::runner for the contract.
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<'de> Deserialize<'de> for CommandResult
impl<'de> Deserialize<'de> for CommandResult
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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