pub struct MetadataCommand { /* private fields */ }Expand description
A builder for scarb metadata command invocation.
In detail, this will always execute scarb --json metadata --format-version N, where N
matches metadata version understandable by this crate version.
Implementations§
Source§impl MetadataCommand
impl MetadataCommand
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a default scarb metadata 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 no_deps(&mut self) -> &mut Self
pub fn no_deps(&mut self) -> &mut Self
Output information only about workspace members and don’t fetch dependencies.
Sourcepub fn profile(&mut self, profile: impl AsRef<OsStr>) -> &mut Self
pub fn profile(&mut self, profile: impl AsRef<OsStr>) -> &mut Self
Defines profile to use for scarb metadata command.
Sourcepub fn release(&mut self) -> &mut Self
pub fn release(&mut self) -> &mut Self
Defines profile to use for scarb metadata command as “release”.
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 inherit_stderr(&mut self) -> &mut Self
pub fn inherit_stderr(&mut self) -> &mut Self
Inherit standard error, i.e. show Scarb errors in this process’s standard error.
Sourcepub fn inherit_stdout(&mut self) -> &mut Self
pub fn inherit_stdout(&mut self) -> &mut Self
Inherit standard output, i.e. show Scarb output in this process’s standard output.
Sourcepub fn exec(&self) -> Result<Metadata, MetadataCommandError>
pub fn exec(&self) -> Result<Metadata, MetadataCommandError>
Runs configured scarb metadata and returns parsed Metadata.
Trait Implementations§
Source§impl Clone for MetadataCommand
impl Clone for MetadataCommand
Source§fn clone(&self) -> MetadataCommand
fn clone(&self) -> MetadataCommand
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more