pub struct SourceMetadata {
pub name: String,
pub path: Option<PathBuf>,
pub url: Option<String>,
pub env_var: Option<String>,
pub priority: i32,
pub optional: bool,
pub labels: Vec<String>,
}Expand description
Metadata about a configuration source.
Contains identifying information and optional attributes. URL metadata is available for custom user-defined sources; this crate does not ship a built-in HTTP source.
Fields§
§name: StringUnique identifier for this source.
path: Option<PathBuf>Optional path (for file sources).
url: Option<String>Optional URL (for remote sources).
env_var: Option<String>Optional environment variable name.
priority: i32Optional priority (higher = more important).
optional: boolWhether this source is optional.
labels: Vec<String>Source-specific labels/tags.
Implementations§
Source§impl SourceMetadata
impl SourceMetadata
Sourcepub fn with_env_var(self, env_var: impl Into<String>) -> Self
pub fn with_env_var(self, env_var: impl Into<String>) -> Self
Set the environment variable name.
Sourcepub const fn with_priority(self, priority: i32) -> Self
pub const fn with_priority(self, priority: i32) -> Self
Set the priority.
Sourcepub const fn with_optional(self, optional: bool) -> Self
pub const fn with_optional(self, optional: bool) -> Self
Set whether this source is optional.
Sourcepub fn with_label(self, label: impl Into<String>) -> Self
pub fn with_label(self, label: impl Into<String>) -> Self
Add a label.
Sourcepub fn display_id(&self) -> String
pub fn display_id(&self) -> String
Get display identifier for this source.
Trait Implementations§
Source§impl Clone for SourceMetadata
impl Clone for SourceMetadata
Source§fn clone(&self) -> SourceMetadata
fn clone(&self) -> SourceMetadata
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 SourceMetadata
impl Debug for SourceMetadata
Source§impl Default for SourceMetadata
impl Default for SourceMetadata
Source§impl<'de> Deserialize<'de> for SourceMetadata
impl<'de> Deserialize<'de> for SourceMetadata
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for SourceMetadata
impl PartialEq for SourceMetadata
Source§impl Serialize for SourceMetadata
impl Serialize for SourceMetadata
impl Eq for SourceMetadata
impl StructuralPartialEq for SourceMetadata
Auto Trait Implementations§
impl Freeze for SourceMetadata
impl RefUnwindSafe for SourceMetadata
impl Send for SourceMetadata
impl Sync for SourceMetadata
impl Unpin for SourceMetadata
impl UnsafeUnpin for SourceMetadata
impl UnwindSafe for SourceMetadata
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