Struct shell_candy::ShellTask
source · [−]pub struct ShellTask { /* private fields */ }Expand description
A ShellTask runs commands and provides a passthrough log handler
for each log line.
Examples
use shell_candy::{Result, ShellTaskLog, ShellTask};
fn main() -> Result<()> {
// Create a task to check the current version of `rustc` that is installed
let task = ShellTask::new("rustc --version", |line| {
match line {
// print all log lines with an "info: " prefix
ShellTaskLog::Stderr(message) | ShellTaskLog::Stdout(message) => eprintln!("info: {}", &message),
}
})?;
// Run the task
task.run()?;
Ok(())
}Implementations
Auto Trait Implementations
impl !RefUnwindSafe for ShellTask
impl Send for ShellTask
impl Sync for ShellTask
impl Unpin for ShellTask
impl !UnwindSafe for ShellTask
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more