pub struct ExecutionStatus {
pub code: StatusCode,
pub detail: StatusDetail,
}Expand description
Complete execution status combining code and detail.
This is the primary type for representing execution outcomes. It provides both machine-readable status codes and human-readable details.
§Example
ⓘ
let status = ExecutionStatus::ok("3 changes in 2 files")
.with_explanation("Renamed 'foo' to 'bar' across the codebase.");
if status.is_success() {
println!("{}: {}", status.code, status.detail.reason);
}Fields§
§code: StatusCodeThe status code.
detail: StatusDetailDetailed information.
Implementations§
Source§impl ExecutionStatus
impl ExecutionStatus
Sourcepub fn new(code: StatusCode, detail: StatusDetail) -> Self
pub fn new(code: StatusCode, detail: StatusDetail) -> Self
Create a new ExecutionStatus.
Sourcepub fn syntax_error(reason: impl Into<String>) -> Self
pub fn syntax_error(reason: impl Into<String>) -> Self
Create a SYNTAX_ERROR status (422).
Sourcepub fn with_explanation(self, explanation: impl Into<String>) -> Self
pub fn with_explanation(self, explanation: impl Into<String>) -> Self
Add an explanation.
Sourcepub fn with_suggestion(self, suggestion: impl Into<String>) -> Self
pub fn with_suggestion(self, suggestion: impl Into<String>) -> Self
Add a suggestion.
Sourcepub fn with_suggestions(
self,
suggestions: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn with_suggestions( self, suggestions: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Add multiple suggestions.
Sourcepub fn with_context(self, context: impl Into<String>) -> Self
pub fn with_context(self, context: impl Into<String>) -> Self
Add context.
Sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Returns true if this is a success status.
Trait Implementations§
Source§impl Clone for ExecutionStatus
impl Clone for ExecutionStatus
Source§fn clone(&self) -> ExecutionStatus
fn clone(&self) -> ExecutionStatus
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 ExecutionStatus
impl Debug for ExecutionStatus
Source§impl<'de> Deserialize<'de> for ExecutionStatus
impl<'de> Deserialize<'de> for ExecutionStatus
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
Source§impl Display for ExecutionStatus
impl Display for ExecutionStatus
Auto Trait Implementations§
impl Freeze for ExecutionStatus
impl RefUnwindSafe for ExecutionStatus
impl Send for ExecutionStatus
impl Sync for ExecutionStatus
impl Unpin for ExecutionStatus
impl UnsafeUnpin for ExecutionStatus
impl UnwindSafe for ExecutionStatus
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,
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more