pub struct Definition {
origin: Origin,
scope: Scope,
}Expand description
Location where a config value is defined.
Fields§
§origin: Origin§scope: ScopeImplementations§
Source§impl Definition
impl Definition
pub const fn builtin() -> Self
pub fn path(path: PathBuf) -> Self
pub fn environment(key: String) -> Self
pub fn cli(path: Option<PathBuf>) -> Self
pub fn origin(&self) -> &Origin
Sourcepub fn root<'a>(&'a self, current_dir: &'a Path) -> &'a Path
pub fn root<'a>(&'a self, current_dir: &'a Path) -> &'a Path
Root directory where this is defined.
If from a file, it is the directory above .cargo/config.toml.
CLI and env use the provided current working directory.
Sourcepub fn parent<'a>(&'a self, current_dir: &'a Path) -> &'a Path
pub fn parent<'a>(&'a self, current_dir: &'a Path) -> &'a Path
Parent directory where this is defined.
If from a file, it is the directory .cargo/.
CLI and env use the provided 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§impl Debug for Definition
impl Debug for Definition
Source§impl Default for Definition
impl Default 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
impl Eq 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 (const: unstable) · 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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for Definition
impl PartialEq for Definition
Source§impl PartialOrd for Definition
impl PartialOrd for Definition
Auto Trait Implementations§
impl Forget for Definition
impl Freeze for Definition
impl Move for Definition
impl RefUnwindSafe for Definition
impl Send for Definitionwhere
RawVecInner: Send,
impl Sync for Definitionwhere
RawVecInner: Sync,
impl Unpin for Definition
impl UnsafeUnpin for Definition
impl UnwindSafe for Definitionwhere
RawVecInner: UnwindSafe,
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
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§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.§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> ⓘ
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: 40 bytes