pub struct ExecutionResult {
pub raw_output: Vec<u8>,
pub text_output: String,
pub exit_code: Option<i32>,
pub duration: Duration,
pub timed_out: bool,
}Expand description
Result of command execution.
Fields§
§raw_output: Vec<u8>Raw output from the terminal.
text_output: StringSanitized text output (ANSI codes stripped).
exit_code: Option<i32>Exit code (if command completed).
duration: DurationExecution duration.
timed_out: boolWhether execution timed out.
Implementations§
Source§impl ExecutionResult
impl ExecutionResult
Sourcepub fn new(raw_output: Vec<u8>, text_output: String, duration: Duration) -> Self
pub fn new(raw_output: Vec<u8>, text_output: String, duration: Duration) -> Self
Create a new execution result.
Sourcepub fn timeout(
raw_output: Vec<u8>,
text_output: String,
duration: Duration,
) -> Self
pub fn timeout( raw_output: Vec<u8>, text_output: String, duration: Duration, ) -> Self
Create a result indicating timeout.
Sourcepub fn with_exit_code(self, code: i32) -> Self
pub fn with_exit_code(self, code: i32) -> Self
Set the exit code.
Sourcepub fn output_trimmed(&self) -> &str
pub fn output_trimmed(&self) -> &str
Get output as string, trimmed.
Sourcepub fn output_lines(&self) -> impl Iterator<Item = &str>
pub fn output_lines(&self) -> impl Iterator<Item = &str>
Get output lines.
Trait Implementations§
Source§impl Clone for ExecutionResult
impl Clone for ExecutionResult
Source§fn clone(&self) -> ExecutionResult
fn clone(&self) -> ExecutionResult
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 ExecutionResult
impl Debug for ExecutionResult
Auto Trait Implementations§
impl Freeze for ExecutionResult
impl RefUnwindSafe for ExecutionResult
impl Send for ExecutionResult
impl Sync for ExecutionResult
impl Unpin for ExecutionResult
impl UnsafeUnpin 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.