pub struct Shell { /* private fields */ }Expand description
A command factory carrying Options (the zx $).
Shell::new() snapshots the current scope; the builder methods return a
modified copy (zx presets such as $({verbose: true})).
Implementations§
Source§impl Shell
impl Shell
Sourcepub fn with_options(opts: Options) -> Self
pub fn with_options(opts: Options) -> Self
A shell with explicit options.
Sourcepub fn options_mut(&mut self) -> &mut Options
pub fn options_mut(&mut self) -> &mut Options
Mutable access to the options.
Sourcepub fn timeout_signal(self, v: impl Into<String>) -> Self
pub fn timeout_signal(self, v: impl Into<String>) -> Self
Signal used on timeout.
Sourcepub fn kill_signal(self, v: impl Into<String>) -> Self
pub fn kill_signal(self, v: impl Into<String>) -> Self
Default signal for kill().
Sourcepub fn prefer_local(self, v: bool) -> Self
pub fn prefer_local(self, v: bool) -> Self
Prepend <cwd>/node_modules/.bin to PATH when true.
Sourcepub fn prefer_local_dirs(self, v: Vec<PathBuf>) -> Self
pub fn prefer_local_dirs(self, v: Vec<PathBuf>) -> Self
Prepend <dir>/node_modules/.bin for each of dirs to PATH.
Sourcepub fn quote_with(self, v: QuoteFn) -> Self
pub fn quote_with(self, v: QuoteFn) -> Self
Use a custom quoting function.
Sourcepub fn env_var(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn env_var(self, key: impl Into<String>, value: impl Into<String>) -> Self
Set a single environment variable (seeding from the process environment when no explicit environment was configured yet).
Sourcepub fn use_powershell(self) -> Self
pub fn use_powershell(self) -> Self
Switch to powershell.exe.
Sourcepub fn cmd<S: AsRef<str>>(&self, pieces: &[S], args: &[ZxArg]) -> ProcessPromise
pub fn cmd<S: AsRef<str>>(&self, pieces: &[S], args: &[ZxArg]) -> ProcessPromise
Build a command from template pieces and arguments (the zx tagged template). Arguments are quoted with the shell’s quote function.
Sourcepub fn command(&self, cmd: impl Into<String>) -> ProcessPromise
pub fn command(&self, cmd: impl Into<String>) -> ProcessPromise
Build a command from a raw string (no interpolation, no quoting).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Shell
impl RefUnwindSafe for Shell
impl Send for Shell
impl Sync for Shell
impl Unpin for Shell
impl UnsafeUnpin for Shell
impl UnwindSafe for Shell
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
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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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> ⓘ
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> ⓘ
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