pub enum Definition {
Path(PathBuf),
Environment(String),
Cli,
}Expand description
Location where a config value is defined.
Variants§
Path(PathBuf)
Defined in a .cargo/config, includes the path to the file.
Environment(String)
Defined in an environment variable, includes the environment key.
Cli
Passed in on the command line.
Implementations§
Source§impl Definition
impl Definition
Sourcepub fn root<'a>(&'a self, config: &'a Config) -> &'a Path
pub fn root<'a>(&'a self, config: &'a Config) -> &'a Path
Root directory where this is defined.
If from a file, it is the directory above .cargo/config.
CLI and env are the current working directory.
Sourcepub fn is_higher_priority(&self, other: &Definition) -> bool
pub fn is_higher_priority(&self, other: &Definition) -> bool
Returns true if self is a higher priority to other.
CLI is preferred over environment, which is preferred over files.
Trait Implementations§
Source§impl Clone for Definition
impl Clone for Definition
Source§fn clone(&self) -> Definition
fn clone(&self) -> Definition
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Definition
impl Debug for Definition
Source§impl<'de> Deserialize<'de> for Definition
impl<'de> Deserialize<'de> for Definition
Source§fn deserialize<D>(deserializer: D) -> Result<Definition, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Definition, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for Definition
impl Display for Definition
Source§impl PartialEq for Definition
impl PartialEq for Definition
impl Eq for Definition
Auto Trait Implementations§
impl Freeze for Definition
impl RefUnwindSafe for Definition
impl Send for Definition
impl Sync for Definition
impl Unpin for Definition
impl UnsafeUnpin for Definition
impl UnwindSafe for Definition
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more