ConanInstall

Struct ConanInstall 

Source
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

Source

pub fn new() -> ConanInstall

Creates a new conan install command with the default recipe path (.).

Source

pub fn with_recipe(recipe_path: &Path) -> ConanInstall

Creates a new conan install command with the user-provided recipe path.

Source

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.

Source

pub fn profile(&mut self, profile: &str) -> &mut ConanInstall

Sets the Conan profile name to use for installing dependencies.

Matches --profile Conan executable option.

Source

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.

Source

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.

Source

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.

Source

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".

Source

pub fn remote(&mut self, remote: &str) -> &mut ConanInstall

Specifies the custom remote name for conan install.

Matches --remote Conan executable option.

Source

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.

Source

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.

Source

pub fn build(&mut self, build: &str) -> &mut ConanInstall

Sets the Conan dependency build policy for conan install.

Matches --build Conan executable option.

Source

pub fn verbosity(&mut self, verbosity: ConanVerbosity) -> &mut ConanInstall

Sets the Conan command verbosity level.

Matches -v Conan executable option.

Source

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().

Source

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.

Trait Implementations§

Source§

impl Default for ConanInstall

Source§

fn default() -> ConanInstall

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.