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
Re-export of cfgmatic-source types for migration convenience. Metadata about a configuration source.
Contains identifying information and optional attributes.
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 new(name: impl Into<String>) -> SourceMetadata
pub fn new(name: impl Into<String>) -> SourceMetadata
Create new metadata with a name.
Sourcepub fn with_path(self, path: impl Into<PathBuf>) -> SourceMetadata
pub fn with_path(self, path: impl Into<PathBuf>) -> SourceMetadata
Set the path.
Sourcepub fn with_url(self, url: impl Into<String>) -> SourceMetadata
pub fn with_url(self, url: impl Into<String>) -> SourceMetadata
Set the URL.
Sourcepub fn with_env_var(self, env_var: impl Into<String>) -> SourceMetadata
pub fn with_env_var(self, env_var: impl Into<String>) -> SourceMetadata
Set the environment variable name.
Sourcepub fn with_priority(self, priority: i32) -> SourceMetadata
pub fn with_priority(self, priority: i32) -> SourceMetadata
Set the priority.
Sourcepub fn with_optional(self, optional: bool) -> SourceMetadata
pub fn with_optional(self, optional: bool) -> SourceMetadata
Set whether this source is optional.
Sourcepub fn with_label(self, label: impl Into<String>) -> SourceMetadata
pub fn with_label(self, label: impl Into<String>) -> SourceMetadata
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§fn default() -> SourceMetadata
fn default() -> SourceMetadata
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SourceMetadata
impl<'de> Deserialize<'de> for SourceMetadata
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SourceMetadata, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SourceMetadata, <__D as Deserializer<'de>>::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
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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