pub struct ConanInstall { /* private fields */ }Expand description
conan install command builder
This opaque type implements a command line builder for
the conan install command invocation.
Implementations§
Source§impl ConanInstall
impl ConanInstall
Sourcepub fn new() -> ConanInstall
pub fn new() -> ConanInstall
Creates a new conan install command with the default recipe path (.).
Sourcepub fn with_recipe(recipe_path: &Path) -> ConanInstall
pub fn with_recipe(recipe_path: &Path) -> ConanInstall
Creates a new conan install command with the user-provided recipe path.
Sourcepub fn output_folder(&mut self, output_folder: &Path) -> &mut ConanInstall
pub fn output_folder(&mut self, output_folder: &Path) -> &mut ConanInstall
Sets a custom Conan generator output folder path.
Matches --output-folder Conan executable option.
This method should not be used in most cases:
The Cargo-provided OUT_DIR environment variable value is used
as the default when the command is invoked from a build script.
Sourcepub fn profile(&mut self, profile: &str) -> &mut ConanInstall
pub fn profile(&mut self, profile: &str) -> &mut ConanInstall
Sets the Conan profile name to use for installing dependencies.
Matches --profile Conan executable option.
Sourcepub fn host_profile(&mut self, profile: &str) -> &mut ConanInstall
pub fn host_profile(&mut self, profile: &str) -> &mut ConanInstall
Sets the Conan host profile name to use for installing dependencies.
Matches --profile:host Conan executable option.
Sourcepub fn build_profile(&mut self, profile: &str) -> &mut ConanInstall
pub fn build_profile(&mut self, profile: &str) -> &mut ConanInstall
Sets the Conan build profile name to use for installing dependencies.
Matches --profile:build Conan executable option.
Sourcepub fn detect_profile(&mut self) -> &mut ConanInstall
pub fn detect_profile(&mut self) -> &mut ConanInstall
Auto-detects and creates the Conan profile to use for installing dependencies.
Schedules conan profile detect --exist-ok to run before running conan install.
Sourcepub fn build_type(&mut self, build_type: &str) -> &mut ConanInstall
pub fn build_type(&mut self, build_type: &str) -> &mut ConanInstall
Overrides the default Conan build type setting value for conan install.
Matches --settings build_type={value} Conan executable option.
NOTE: The default value for this setting will be inferred automatically
depending on the current Cargo build profile as either
"Debug" or "Release".
Sourcepub fn remote(&mut self, remote: &str) -> &mut ConanInstall
pub fn remote(&mut self, remote: &str) -> &mut ConanInstall
Specifies the custom remote name for conan install.
Matches --remote Conan executable option.
Sourcepub fn config(&mut self, key: &str, value: &str) -> &mut ConanInstall
pub fn config(&mut self, key: &str, value: &str) -> &mut ConanInstall
Adds the Conan configuration options (confs).
Matches --conf {key}={value} Conan executable option.
Can be called multiple times per Conan invocation.
Sourcepub fn option(
&mut self,
scope: ConanScope<'_>,
key: &str,
value: &str,
) -> &mut ConanInstall
pub fn option( &mut self, scope: ConanScope<'_>, key: &str, value: &str, ) -> &mut ConanInstall
Adds the Conan package options to use for installing dependencies.
Matches --options {scope}:{key}={value} Conan executable option.
Can be called multiple times per Conan invocation.
Sourcepub fn build(&mut self, build: &str) -> &mut ConanInstall
pub fn build(&mut self, build: &str) -> &mut ConanInstall
Sets the Conan dependency build policy for conan install.
Matches --build Conan executable option.
Sourcepub fn verbosity(&mut self, verbosity: ConanVerbosity) -> &mut ConanInstall
pub fn verbosity(&mut self, verbosity: ConanVerbosity) -> &mut ConanInstall
Sets the Conan command verbosity level.
Matches -v Conan executable option.
Sourcepub fn arg(&mut self, arg: &str) -> &mut ConanInstall
pub fn arg(&mut self, arg: &str) -> &mut ConanInstall
Adds one extra command line argument to the final conan install run.
Can be called multiple times per Conan invocation.
This method is a proxy for std::process::Command::arg().
Sourcepub fn run(&self) -> ConanOutput
pub fn run(&self) -> ConanOutput
Runs the conan install command and captures its JSON-formatted output.
§Panics
Panics if the Conan executable cannot be found.