[][src]Struct cargo::util::config::Config

pub struct Config { /* fields omitted */ }

Configuration information for cargo. This is not specific to a build, it is information relating to cargo itself.

This struct implements Default: all fields can be inferred.

Methods

impl Config[src]

pub fn new(shell: Shell, cwd: PathBuf, homedir: PathBuf) -> Config[src]

pub fn default() -> CargoResult<Config>[src]

pub fn home(&self) -> &Filesystem[src]

Gets the user's Cargo home directory (OS-dependent).

pub fn git_path(&self) -> Filesystem[src]

Gets the Cargo Git directory (<cargo_home>/git).

pub fn registry_index_path(&self) -> Filesystem[src]

Gets the Cargo registry index directory (<cargo_home>/registry/index).

pub fn registry_cache_path(&self) -> Filesystem[src]

Gets the Cargo registry cache directory (<cargo_home>/registry/path).

pub fn registry_source_path(&self) -> Filesystem[src]

Gets the Cargo registry source directory (<cargo_home>/registry/src).

pub fn default_registry(&self) -> CargoResult<Option<String>>[src]

Gets the default Cargo registry.

pub fn shell(&self) -> RefMut<Shell>[src]

Gets a reference to the shell, e.g., for writing error messages.

pub fn rustdoc(&self) -> CargoResult<&Path>[src]

Gets the path to the rustdoc executable.

pub fn load_global_rustc(&self, ws: Option<&Workspace>) -> CargoResult<Rustc>[src]

Gets the path to the rustc executable.

pub fn cargo_exe(&self) -> CargoResult<&Path>[src]

Gets the path to the cargo executable.

pub fn profiles(&self) -> CargoResult<&ConfigProfiles>[src]

pub fn updated_sources(&self) -> RefMut<HashSet<SourceId>>[src]

pub fn values(&self) -> CargoResult<&HashMap<String, ConfigValue>>[src]

pub fn values_mut(&mut self) -> CargoResult<&mut HashMap<String, ConfigValue>>[src]

pub fn set_values(
    &self,
    values: HashMap<String, ConfigValue>
) -> CargoResult<()>
[src]

pub fn reload_rooted_at<P: AsRef<Path>>(&mut self, path: P) -> CargoResult<()>[src]

pub fn cwd(&self) -> &Path[src]

pub fn target_dir(&self) -> CargoResult<Option<Filesystem>>[src]

pub fn set_env(&mut self, env: HashMap<String, String>)[src]

pub fn get_string(&self, key: &str) -> CargoResult<OptValue<String>>[src]

pub fn get_path(&self, key: &str) -> CargoResult<OptValue<PathBuf>>[src]

pub fn get_path_and_args(
    &self,
    key: &str
) -> CargoResult<OptValue<(PathBuf, Vec<String>)>>
[src]

pub fn get_list(
    &self,
    key: &str
) -> CargoResult<OptValue<Vec<(String, PathBuf)>>>
[src]

pub fn get_table(&self, key: &str) -> CargoResult<OptValue<HashMap<String, CV>>>[src]

pub fn configure(
    &mut self,
    verbose: u32,
    quiet: Option<bool>,
    color: &Option<String>,
    frozen: bool,
    locked: bool,
    offline: bool,
    target_dir: &Option<PathBuf>,
    unstable_flags: &[String]
) -> CargoResult<()>
[src]

pub fn cli_unstable(&self) -> &CliUnstable[src]

pub fn extra_verbose(&self) -> bool[src]

pub fn network_allowed(&self) -> bool[src]

pub fn offline(&self) -> bool[src]

pub fn frozen(&self) -> bool[src]

pub fn lock_update_allowed(&self) -> bool[src]

pub fn load_values(&self) -> CargoResult<HashMap<String, ConfigValue>>[src]

Loads configuration from the filesystem.

pub fn get_registry_index(&self, registry: &str) -> CargoResult<Url>[src]

Gets the index for a registry.

pub fn get_default_registry_index(&self) -> CargoResult<Option<Url>>[src]

Gets the index for the default registry.

pub fn jobserver_from_env(&self) -> Option<&Client>[src]

pub fn http(&self) -> CargoResult<&RefCell<Easy>>[src]

pub fn http_config(&self) -> CargoResult<&CargoHttpConfig>[src]

pub fn net_config(&self) -> CargoResult<&CargoNetConfig>[src]

pub fn build_config(&self) -> CargoResult<&CargoBuildConfig>[src]

pub fn crates_io_source_id<F>(&self, f: F) -> CargoResult<SourceId> where
    F: FnMut() -> CargoResult<SourceId>, 
[src]

pub fn creation_time(&self) -> Instant[src]

pub fn get<'de, T: Deserialize<'de>>(&self, key: &str) -> CargoResult<T>[src]

pub fn assert_package_cache_locked<'a>(&self, f: &'a Filesystem) -> &'a Path[src]

pub fn acquire_package_cache_lock(&self) -> CargoResult<PackageCacheLock>[src]

Acquires an exclusive lock on the global "package cache"

This lock is global per-process and can be acquired recursively. An RAII structure is returned to release the lock, and if this process abnormally terminates the lock is also released.

pub fn release_package_cache_lock(&self)[src]

Trait Implementations

impl Debug for Config[src]

Auto Trait Implementations

impl !RefUnwindSafe for Config

impl !Send for Config

impl !Sync for Config

impl Unpin for Config

impl !UnwindSafe for Config

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,