pub struct CommandContext {
pub args: Vec<String>,
pub stdin: Option<String>,
pub cwd: Option<PathBuf>,
pub env: Option<HashMap<String, String>>,
pub output_tx: Option<Sender<StreamChunk>>,
pub is_cancelled: Option<Box<dyn Fn() -> bool + Send + Sync>>,
}Expand description
Context for virtual command execution
Fields§
§args: Vec<String>Command arguments (excluding the command name)
stdin: Option<String>Standard input content
cwd: Option<PathBuf>Current working directory
env: Option<HashMap<String, String>>Environment variables
output_tx: Option<Sender<StreamChunk>>Channel to send streaming output
is_cancelled: Option<Box<dyn Fn() -> bool + Send + Sync>>Cancellation check function
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for CommandContext
impl !UnwindSafe for CommandContext
impl Freeze for CommandContext
impl Send for CommandContext
impl Sync for CommandContext
impl Unpin for CommandContext
impl UnsafeUnpin for CommandContext
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> 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