pub struct ExecutionResult {
pub next_control_flow: ExecutionControlFlow,
pub exit_code: ExecutionExitCode,
}Expand description
Represents the result of executing a command or similar item.
Fields§
§next_control_flow: ExecutionControlFlowThe control flow transition to apply after execution.
exit_code: ExecutionExitCodeThe exit code resulting from execution.
Implementations§
Source§impl ExecutionResult
impl ExecutionResult
Sourcepub fn new(exit_code: u8) -> Self
pub fn new(exit_code: u8) -> Self
Returns a new ExecutionResult with the given exit code.
§Arguments
exit_code- The exit code of the command.
Sourcepub const fn general_error() -> Self
pub const fn general_error() -> Self
Returns a new ExecutionResult with a general error exit code.
Sourcepub const fn is_success(&self) -> bool
pub const fn is_success(&self) -> bool
Returns whether the command was successful.
Sourcepub const fn is_normal_flow(&self) -> bool
pub const fn is_normal_flow(&self) -> bool
Returns whether the execution result indicates normal control flow.
Returns false if there is any control flow transition requested.
Sourcepub const fn is_break(&self) -> bool
pub const fn is_break(&self) -> bool
Returns whether the execution result indicates a loop break.
Sourcepub const fn is_continue(&self) -> bool
pub const fn is_continue(&self) -> bool
Returns whether the execution result indicates a loop continue.
Sourcepub const fn is_return_or_exit(&self) -> bool
pub const fn is_return_or_exit(&self) -> bool
Returns whether the execution result indicates an early return
from a function or script, or an exit from the shell. Returns false
otherwise, including loop breaks or continues.
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Returns whether the execution was cancelled (exit code 130).
Trait Implementations§
Source§impl Default for ExecutionResult
impl Default for ExecutionResult
Source§fn default() -> ExecutionResult
fn default() -> ExecutionResult
Source§impl From<ExecutionExitCode> for ExecutionResult
impl From<ExecutionExitCode> for ExecutionResult
Source§fn from(exit_code: ExecutionExitCode) -> Self
fn from(exit_code: ExecutionExitCode) -> Self
Source§impl From<ExecutionResult> for ExecutionSpawnResult
impl From<ExecutionResult> for ExecutionSpawnResult
Source§fn from(result: ExecutionResult) -> Self
fn from(result: ExecutionResult) -> Self
Source§impl From<Output> for ExecutionResult
impl From<Output> for ExecutionResult
Source§impl From<ProcessWaitResult> for ExecutionResult
impl From<ProcessWaitResult> for ExecutionResult
Source§fn from(wait_result: ProcessWaitResult) -> Self
fn from(wait_result: ProcessWaitResult) -> Self
Auto Trait Implementations§
impl Freeze for ExecutionResult
impl RefUnwindSafe for ExecutionResult
impl Send for ExecutionResult
impl Sync for ExecutionResult
impl Unpin for ExecutionResult
impl UnwindSafe for ExecutionResult
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
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>
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>
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