Struct cargo_subcommand::LocalizedConfig
source · [−]pub struct LocalizedConfig {
pub config: Config,
pub workspace: PathBuf,
}Fields
config: Configworkspace: PathBufThe directory containing ./.cargo/config.toml
Implementations
sourceimpl LocalizedConfig
impl LocalizedConfig
pub fn new(workspace: PathBuf) -> Result<Self, Error>
sourcepub fn find_cargo_config_for_workspace(
workspace: impl AsRef<Path>
) -> Result<Option<Self>, Error>
pub fn find_cargo_config_for_workspace(
workspace: impl AsRef<Path>
) -> Result<Option<Self>, Error>
Search for and open .cargo/config.toml in any parent of the workspace root path.
sourcepub fn resolve_env(&self, key: &str) -> Result<Cow<'_, str>, EnvError>
pub fn resolve_env(&self, key: &str) -> Result<Cow<'_, str>, EnvError>
Read an environment variable from the [env] section in this .cargo/config.toml.
It is interpreted as path and canonicalized relative to Self::workspace if
EnvOption::Value::relative is set.
Process environment variables (from std::env::var()) have precedence
unless EnvOption::Value::force is set. This value is also returned if
the given key was not set under [env].
Trait Implementations
sourceimpl Clone for LocalizedConfig
impl Clone for LocalizedConfig
sourcefn clone(&self) -> LocalizedConfig
fn clone(&self) -> LocalizedConfig
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for LocalizedConfig
impl Debug for LocalizedConfig
Auto Trait Implementations
impl RefUnwindSafe for LocalizedConfig
impl Send for LocalizedConfig
impl Sync for LocalizedConfig
impl Unpin for LocalizedConfig
impl UnwindSafe for LocalizedConfig
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more