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, gctx: &'a GlobalContext) -> &'a Path
pub fn root<'a>(&'a self, gctx: &'a GlobalContext) -> &'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
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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>,
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,
Source§impl PartialEq for Definition
impl PartialEq for Definition
Source§impl PartialOrd for Definition
impl PartialOrd 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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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
§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
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 32 bytes
Size for each variant:
Path
: 24 bytesEnvironment
: 24 bytesCli
: 24 bytes