Struct ConfigCollector

Source
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>

Source

pub fn new(dest: C, source: ConfigLoader<S>) -> Result<Self, String>

Creates new instance.

Source

pub fn get_config_source(&self) -> &ConfigLoader<S>

Source

pub fn insert_file<P>( &mut self, path: P, content: String, ) -> Result<ConfigCollectorDestRes, String>
where P: AsRef<Path>,

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.

Source

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.

Source

pub fn serialize_to_string(&self) -> Result<String, String>

Serializes the storage content (structured) as String. Depends on realization, but normally it is JSON.

Auto Trait Implementations§

§

impl<C, S> Freeze for ConfigCollector<C, S>
where C: Freeze, S: Freeze,

§

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>
where C: Unpin, S: Unpin,

§

impl<C, S> !UnwindSafe for ConfigCollector<C, S>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.