pub struct SourceConfig {
pub name: String,
pub optional: bool,
pub priority: i32,
pub cache: bool,
pub format: Option<String>,
pub path: Option<PathBuf>,
pub url: Option<String>,
pub env_prefix: Option<String>,
pub extra: BTreeMap<String, String>,
}Expand description
Configuration for a single source.
Describes how to load configuration from a specific source.
Fields§
§name: StringName/identifier for this source.
optional: boolWhether this source is optional.
priority: i32Priority for this source (higher = more important).
cache: boolWhether to cache the loaded content.
format: Option<String>Format override (auto-detected if None).
path: Option<PathBuf>Source-specific path (for file sources).
url: Option<String>Source-specific URL for custom URL-backed sources.
env_prefix: Option<String>Source-specific environment variable prefix.
extra: BTreeMap<String, String>Additional source-specific options.
Implementations§
Source§impl SourceConfig
impl SourceConfig
Sourcepub fn builder() -> SourceConfigBuilder
pub fn builder() -> SourceConfigBuilder
Create a builder for constructing a SourceConfig.
Sourcepub const fn is_optional(&self) -> bool
pub const fn is_optional(&self) -> bool
Check if this is an optional source.
Sourcepub fn display_id(&self) -> String
pub fn display_id(&self) -> String
Get the display identifier for this source.
Trait Implementations§
Source§impl Clone for SourceConfig
impl Clone for SourceConfig
Source§fn clone(&self) -> SourceConfig
fn clone(&self) -> SourceConfig
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 SourceConfig
impl Debug for SourceConfig
Source§impl Default for SourceConfig
impl Default for SourceConfig
Source§impl<'de> Deserialize<'de> for SourceConfig
impl<'de> Deserialize<'de> for SourceConfig
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 SourceConfig
impl PartialEq for SourceConfig
Source§impl Serialize for SourceConfig
impl Serialize for SourceConfig
impl Eq for SourceConfig
impl StructuralPartialEq for SourceConfig
Auto Trait Implementations§
impl Freeze for SourceConfig
impl RefUnwindSafe for SourceConfig
impl Send for SourceConfig
impl Sync for SourceConfig
impl Unpin for SourceConfig
impl UnsafeUnpin for SourceConfig
impl UnwindSafe for SourceConfig
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