Enum cargo::util::config::Definition
source · pub enum Definition {
Path(PathBuf),
Environment(String),
Cli(Option<PathBuf>),
}
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(Option<PathBuf>)
Passed in on the command line. A path is attached when the config value is a path to a config file.
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 copy 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 Ord for Definition
impl Ord for Definition
source§fn cmp(&self, other: &Definition) -> Ordering
fn cmp(&self, other: &Definition) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for Definition
impl PartialEq for Definition
source§fn eq(&self, other: &Definition) -> bool
fn eq(&self, other: &Definition) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for Definition
impl PartialOrd for Definition
source§fn partial_cmp(&self, other: &Definition) -> Option<Ordering>
fn partial_cmp(&self, other: &Definition) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Definition
Auto Trait Implementations§
impl RefUnwindSafe for Definition
impl Send for Definition
impl Sync for Definition
impl Unpin 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
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.