pub struct File<T, F> { /* private fields */ }
Expand description
A configuration source backed up by a file.
It supports optional automatic file format discovery.
Implementations§
Source§impl<F> File<FileSourceString, F>where
F: FileStoredFormat + 'static,
impl<F> File<FileSourceString, F>where
F: FileStoredFormat + 'static,
pub fn from_str(s: &str, format: F) -> File<FileSourceString, F>
Source§impl<F> File<FileSourceFile, F>where
F: FileStoredFormat + 'static,
impl<F> File<FileSourceFile, F>where
F: FileStoredFormat + 'static,
pub fn new(name: &str, format: F) -> File<FileSourceFile, F>
Source§impl File<FileSourceFile, FileFormat>
impl File<FileSourceFile, FileFormat>
Sourcepub fn with_name(base_name: &str) -> File<FileSourceFile, FileFormat>
pub fn with_name(base_name: &str) -> File<FileSourceFile, FileFormat>
Given the basename of a file, will attempt to locate a file by setting its extension to a registered format.
Trait Implementations§
Source§impl<'a> From<&'a Path> for File<FileSourceFile, FileFormat>
impl<'a> From<&'a Path> for File<FileSourceFile, FileFormat>
Source§fn from(path: &'a Path) -> File<FileSourceFile, FileFormat>
fn from(path: &'a Path) -> File<FileSourceFile, FileFormat>
Converts to this type from the input type.
Source§impl From<PathBuf> for File<FileSourceFile, FileFormat>
impl From<PathBuf> for File<FileSourceFile, FileFormat>
Source§fn from(path: PathBuf) -> File<FileSourceFile, FileFormat>
fn from(path: PathBuf) -> File<FileSourceFile, FileFormat>
Converts to this type from the input type.
Source§impl<T, F> Source for File<T, F>where
F: FileStoredFormat + Debug + Clone + Send + Sync + 'static,
T: Sync + Send + FileSource<F> + 'static,
impl<T, F> Source for File<T, F>where
F: FileStoredFormat + Debug + Clone + Send + Sync + 'static,
T: Sync + Send + FileSource<F> + 'static,
fn clone_into_box(&self) -> Box<dyn Source + Sync + Send>
Source§fn collect(&self) -> Result<HashMap<String, Value>, ConfigError>
fn collect(&self) -> Result<HashMap<String, Value>, ConfigError>
Collect all configuration properties available from this source into
a
Map
.Source§fn collect_to(&self, cache: &mut Value) -> Result<(), ConfigError>
fn collect_to(&self, cache: &mut Value) -> Result<(), ConfigError>
Collects all configuration properties to a provided cache.
Auto Trait Implementations§
impl<T, F> Freeze for File<T, F>
impl<T, F> RefUnwindSafe for File<T, F>where
T: RefUnwindSafe,
F: RefUnwindSafe,
impl<T, F> Send for File<T, F>
impl<T, F> Sync for File<T, F>
impl<T, F> Unpin for File<T, F>
impl<T, F> UnwindSafe for File<T, F>where
T: UnwindSafe,
F: UnwindSafe,
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