Struct scsys_core::ConfigFile
source · [−]pub struct ConfigFile<T, F> { /* private fields */ }
Expand description
A configuration source backed up by a file.
It supports optional automatic file format discovery.
Implementations
sourceimpl<F> File<FileSourceString, F> where
F: 'static + FileStoredFormat,
impl<F> File<FileSourceString, F> where
F: 'static + FileStoredFormat,
pub fn from_str(s: &str, format: F) -> File<FileSourceString, F>
sourceimpl<F> File<FileSourceFile, F> where
F: 'static + FileStoredFormat,
impl<F> File<FileSourceFile, F> where
F: 'static + FileStoredFormat,
pub fn new(name: &str, format: F) -> File<FileSourceFile, F>
sourceimpl File<FileSourceFile, FileFormat>
impl File<FileSourceFile, FileFormat>
sourcepub fn with_name(name: &str) -> File<FileSourceFile, FileFormat>
pub fn with_name(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
sourceimpl<'a> From<&'a Path> for File<FileSourceFile, FileFormat>
impl<'a> From<&'a Path> for File<FileSourceFile, FileFormat>
sourcefn from(path: &'a Path) -> File<FileSourceFile, FileFormat>
fn from(path: &'a Path) -> File<FileSourceFile, FileFormat>
Converts to this type from the input type.
sourceimpl From<PathBuf> for File<FileSourceFile, FileFormat>
impl From<PathBuf> for File<FileSourceFile, FileFormat>
sourcefn from(path: PathBuf) -> File<FileSourceFile, FileFormat>
fn from(path: PathBuf) -> File<FileSourceFile, FileFormat>
Converts to this type from the input type.
sourceimpl<T, F> Source for File<T, F> where
F: 'static + FileStoredFormat + Debug + Clone + Send + Sync,
T: 'static + Sync + Send + FileSource<F>,
impl<T, F> Source for File<T, F> where
F: 'static + FileStoredFormat + Debug + Clone + Send + Sync,
T: 'static + Sync + Send + FileSource<F>,
fn clone_into_box(&self) -> Box<dyn Source + Send + Sync + 'static, Global>
sourcefn collect(&self) -> Result<HashMap<String, Value, RandomState>, ConfigError>
fn collect(&self) -> Result<HashMap<String, Value, RandomState>, ConfigError>
Collect all configuration properties available from this source and return a Map. Read more
sourcefn 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> RefUnwindSafe for File<T, F> where
F: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, F> Send for File<T, F> where
F: Send,
T: Send,
impl<T, F> Sync for File<T, F> where
F: Sync,
T: Sync,
impl<T, F> Unpin for File<T, F> where
F: Unpin,
T: Unpin,
impl<T, F> UnwindSafe for File<T, F> where
F: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more