pub struct FoundConfigFiles<'srcs> {
files: Vec<FoundConfigFile>,
sources: &'srcs ConfigurationSources,
}
Expand description
Configuration files and directories we found in the filesystem
Result of ConfigurationSources::scan
.
When loading configuration files and also watching for filesystem updates, this type encapsulates all the actual filesystem objects that need watching.
Fields§
§files: Vec<FoundConfigFile>
The things we found
This includes both:
- Files which ought to be read
- Directories, which may or may not contain any currently-relevant files
The directories are retained for the purpose of watching for config changes:
we will want to detect files being created within them,
so our caller needs to discover them (via FoundConfigFiles::iter()
).
sources: &'srcs ConfigurationSources
Our parent, which contains details we need for load
Implementations§
Source§impl FoundConfigFiles<'_>
impl FoundConfigFiles<'_>
Sourcepub fn iter(&self) -> impl Iterator<Item = &ConfigurationSource>
pub fn iter(&self) -> impl Iterator<Item = &ConfigurationSource>
Iterate over the filesystem objects that the scan found
Sourcefn add_sources(self, builder: Figment) -> Result<Figment, ConfigError>
fn add_sources(self, builder: Figment) -> Result<Figment, ConfigError>
Add every file and commandline source to builder
, returning a new
builder.
Sourcepub fn load(self) -> Result<ConfigurationTree, ConfigError>
pub fn load(self) -> Result<ConfigurationTree, ConfigError>
Load the configuration into a new ConfigurationTree
.
Trait Implementations§
Auto Trait Implementations§
impl<'srcs> Freeze for FoundConfigFiles<'srcs>
impl<'srcs> RefUnwindSafe for FoundConfigFiles<'srcs>
impl<'srcs> Send for FoundConfigFiles<'srcs>
impl<'srcs> Sync for FoundConfigFiles<'srcs>
impl<'srcs> Unpin for FoundConfigFiles<'srcs>
impl<'srcs> UnwindSafe for FoundConfigFiles<'srcs>
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
§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>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more