pub struct ConfigCollector<C: ConfigCollectorDest, S> { /* private fields */ }
Expand description
An instance which stores the collector of configuration where
C
implements the ConfigCollectorDest.
Implementations§
Source§impl<C: ConfigCollectorDest, S> ConfigCollector<C, S>
impl<C: ConfigCollectorDest, S> ConfigCollector<C, S>
Sourcepub fn new(dest: C, source: ConfigLoader<S>) -> Result<Self, String>
pub fn new(dest: C, source: ConfigLoader<S>) -> Result<Self, String>
Creates new instance.
pub fn get_config_source(&self) -> &ConfigLoader<S>
Sourcepub fn insert_file<P>(
&mut self,
path: P,
content: String,
) -> Result<ConfigCollectorDestRes, String>
pub fn insert_file<P>( &mut self, path: P, content: String, ) -> Result<ConfigCollectorDestRes, String>
Inserts a content (any) structured as UTF-8 string to the storage with the provided path
.
§Arguments
-
‘path’ - a path to the object in the virtual storage.
-
content
- a content to store
§Returns
A Result is returned.
-
Result::Ok is returned with ConfigCollectorDestRes.
-
Result::Err is returned in case of error with error description as String.
Sourcepub fn exists<P: AsRef<Path>>(
&self,
path: P,
) -> Result<ConfigCollectorDestRes, String>
pub fn exists<P: AsRef<Path>>( &self, path: P, ) -> Result<ConfigCollectorDestRes, String>
Checks if item exists on the provided path. Depends on the implementation, but normally directories or dataset collections should also be checked.
§Arguments
- ‘path’ - a path to the object in the virtual storage.
A Result is returned.
-
Result::Ok is returned with ConfigCollectorDestRes.
-
Result::Err is returned in case of error with error description as String.
Auto Trait Implementations§
impl<C, S> Freeze for ConfigCollector<C, S>
impl<C, S> !RefUnwindSafe for ConfigCollector<C, S>
impl<C, S> !Send for ConfigCollector<C, S>
impl<C, S> !Sync for ConfigCollector<C, S>
impl<C, S> Unpin for ConfigCollector<C, S>
impl<C, S> !UnwindSafe for ConfigCollector<C, S>
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