pub struct ConfigHierarchy { /* private fields */ }Expand description
Configuration hierarchy manager
Implementations§
Source§impl ConfigHierarchy
impl ConfigHierarchy
Sourcepub fn discover(start_path: &Path) -> Result<Self>
pub fn discover(start_path: &Path) -> Result<Self>
Discover configuration hierarchy for a given path
Sourcepub fn locations(&self) -> &[ConfigLocation]
pub fn locations(&self) -> &[ConfigLocation]
Get all configuration locations in order of precedence
Sourcepub fn primary_location(&self) -> Option<&ConfigLocation>
pub fn primary_location(&self) -> Option<&ConfigLocation>
Get the most specific existing configuration location
Sourcepub fn get_or_create_location(
&self,
prefer_level: Option<ConfigLevel>,
) -> Result<&ConfigLocation>
pub fn get_or_create_location( &self, prefer_level: Option<ConfigLevel>, ) -> Result<&ConfigLocation>
Get or create the most appropriate configuration location
Sourcepub fn init_config(&self, level: ConfigLevel) -> Result<PathBuf>
pub fn init_config(&self, level: ConfigLevel) -> Result<PathBuf>
Initialize a configuration at the specified level
Sourcepub fn get_override_storage_path(&self) -> Result<PathBuf>
pub fn get_override_storage_path(&self) -> Result<PathBuf>
Get the path for override storage at the appropriate level
Sourcepub fn get_all_override_paths(&self) -> Vec<PathBuf>
pub fn get_all_override_paths(&self) -> Vec<PathBuf>
Aggregate override files from all levels
Auto Trait Implementations§
impl Freeze for ConfigHierarchy
impl RefUnwindSafe for ConfigHierarchy
impl Send for ConfigHierarchy
impl Sync for ConfigHierarchy
impl Unpin for ConfigHierarchy
impl UnwindSafe for ConfigHierarchy
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