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
sourceimpl 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
sourceimpl Clone for Definition
impl Clone for Definition
sourcefn clone(&self) -> Definition
fn clone(&self) -> Definition
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 Definition
impl Debug for Definition
sourceimpl<'de> Deserialize<'de> for Definition
impl<'de> Deserialize<'de> for Definition
sourcefn 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
sourceimpl Display for Definition
impl Display for Definition
sourceimpl PartialEq<Definition> for Definition
impl PartialEq<Definition> for Definition
impl Eq for Definition
impl StructuralEq 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
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<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.