Struct brush_core::ExecutionResult
source · pub struct ExecutionResult {
pub exit_code: u8,
pub exit_shell: bool,
pub return_from_function_or_script: bool,
pub break_loop: Option<u8>,
pub continue_loop: Option<u8>,
}Expand description
Encapsulates the result of executing a command.
Fields§
§exit_code: u8The numerical exit code of the command.
exit_shell: boolWhether the shell should exit after this command.
return_from_function_or_script: boolWhether the shell should return from the current function or script.
break_loop: Option<u8>If the command was executed in a loop, this is the number of levels to break out of.
continue_loop: Option<u8>If the command was executed in a loop, this is the number of levels to continue.
Implementations§
source§impl ExecutionResult
impl ExecutionResult
sourcepub fn new(exit_code: u8) -> ExecutionResult
pub fn new(exit_code: u8) -> ExecutionResult
Returns a new ExecutionResult with the given exit code.
§Parameters
exit_code- The exit code of the command.
sourcepub fn success() -> ExecutionResult
pub fn success() -> ExecutionResult
Returns a new ExecutionResult with an exit code of 0.
sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Returns whether the command was successful.
Trait Implementations§
source§impl Debug for ExecutionResult
impl Debug for ExecutionResult
source§impl Default for ExecutionResult
impl Default for ExecutionResult
source§fn default() -> ExecutionResult
fn default() -> ExecutionResult
Returns the “default value” for a type. Read more
source§impl From<ExecutionResult> for ExitCode
impl From<ExecutionResult> for ExitCode
source§fn from(result: ExecutionResult) -> Self
fn from(result: ExecutionResult) -> Self
Converts to this type from the input type.
source§impl From<Output> for ExecutionResult
impl From<Output> for ExecutionResult
source§fn from(output: Output) -> ExecutionResult
fn from(output: Output) -> ExecutionResult
Converts to this type from the input type.
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
Mutably borrows from an owned value. Read more
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