pub struct ScarbCommand { /* private fields */ }Expand description
A builder for scarb command invocation.
Implementations§
Source§impl ScarbCommand
impl ScarbCommand
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a default scarb command, which will look for scarb in $PATH and
for Scarb.toml in the current directory or its ancestors.
Sourcepub fn scarb_path(&mut self, path: impl Into<PathBuf>) -> &mut Self
pub fn scarb_path(&mut self, path: impl Into<PathBuf>) -> &mut Self
Path to scarb executable.
If not set, this will use the $SCARB environment variable, and if that is not set, it
will simply be scarb and the system will look it up in $PATH.
Sourcepub fn manifest_path(&mut self, path: impl Into<PathBuf>) -> &mut Self
pub fn manifest_path(&mut self, path: impl Into<PathBuf>) -> &mut Self
Path to Scarb.toml.
If not set, this will look for Scarb.toml in the current directory or its ancestors.
Sourcepub fn current_dir(&mut self, path: impl Into<PathBuf>) -> &mut Self
pub fn current_dir(&mut self, path: impl Into<PathBuf>) -> &mut Self
Current directory of the scarb metadata process.
Sourcepub fn env(
&mut self,
key: impl AsRef<OsStr>,
val: impl AsRef<OsStr>,
) -> &mut Self
pub fn env( &mut self, key: impl AsRef<OsStr>, val: impl AsRef<OsStr>, ) -> &mut Self
Inserts or updates an environment variable mapping.
Sourcepub fn envs<I, K, V>(&mut self, vars: I) -> &mut Self
pub fn envs<I, K, V>(&mut self, vars: I) -> &mut Self
Adds or updates multiple environment variable mappings.
Sourcepub fn env_remove(&mut self, key: impl AsRef<OsStr>) -> &mut Self
pub fn env_remove(&mut self, key: impl AsRef<OsStr>) -> &mut Self
Removes an environment variable mapping.
Sourcepub fn env_clear(&mut self) -> &mut Self
pub fn env_clear(&mut self) -> &mut Self
Clears the entire environment map for the child process.
Sourcepub fn run(&self) -> Result<(), ScarbCommandError>
pub fn run(&self) -> Result<(), ScarbCommandError>
Runs configured scarb command.
Trait Implementations§
Source§impl Clone for ScarbCommand
impl Clone for ScarbCommand
Source§fn clone(&self) -> ScarbCommand
fn clone(&self) -> ScarbCommand
Returns a duplicate of the value. Read more
1.0.0 · 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 ScarbCommand
impl Debug for ScarbCommand
Source§impl Default for ScarbCommand
impl Default for ScarbCommand
Source§fn default() -> ScarbCommand
fn default() -> ScarbCommand
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ScarbCommand
impl RefUnwindSafe for ScarbCommand
impl Send for ScarbCommand
impl Sync for ScarbCommand
impl Unpin for ScarbCommand
impl UnwindSafe for ScarbCommand
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