pub struct LocalShell { /* private fields */ }Expand description
The local executor: commands run as bash -c child processes on this
host, streamed line by line, killed past their timeout (kill_on_drop
so the dropped child handle kills a still-running process).
Trait Implementations§
Source§impl Clone for LocalShell
impl Clone for LocalShell
Source§impl Debug for LocalShell
impl Debug for LocalShell
Source§impl Default for LocalShell
Available on crate feature local-shell only.
impl Default for LocalShell
Available on crate feature
local-shell only.Source§impl ShellExecutor for LocalShell
impl ShellExecutor for LocalShell
Source§fn run<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
command: &'life1 str,
cwd: &'life2 Path,
timeout: Duration,
cancelled: &'life3 AtomicBool,
progress: &'life4 mut (dyn for<'a> FnMut(&'a str) + Send),
) -> Pin<Box<dyn Future<Output = Result<Executed, ShellError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn run<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
command: &'life1 str,
cwd: &'life2 Path,
timeout: Duration,
cancelled: &'life3 AtomicBool,
progress: &'life4 mut (dyn for<'a> FnMut(&'a str) + Send),
) -> Pin<Box<dyn Future<Output = Result<Executed, ShellError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Runs
command with bash -c and cwd as working directory,
streaming complete output lines through progress as they land
and returning what the command left behind. A command outliving
timeout is killed and reported as ShellError::Timeout; a
flip of cancelled mid-run stops the run with
ShellError::Cancelled. Implementations must not panic and
must not abort: every failure comes back as a ShellError.Auto Trait Implementations§
impl Forget for LocalShell
impl Freeze for LocalShell
impl RefUnwindSafe for LocalShell
impl Send for LocalShell
impl Sync for LocalShell
impl Unpin for LocalShell
impl UnsafeUnpin for LocalShell
impl UnwindSafe for LocalShell
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