pub struct FileParserBuilder<L: Load + Default> { /* private fields */ }
Expand description

Builder for FileParser.

Implementations§

source§

impl<L: Load + Default + Clone> FileParserBuilder<L>

source

pub fn default_path<VALUE: Into<PathBuf>>(&mut self, value: VALUE) -> &mut Self

Set default path to the file to be parsed.

source

pub fn path_option<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self

Set path option name which could be used to get path value from previous parsing Value results.

source

pub fn keys_delimiter<VALUE: Into<String>>(&mut self, value: VALUE) -> &mut Self

Set delimiter used to separate keys levels in path value. Default is DEFAULT_KEYS_SEPARATOR.

source

pub fn ignore_missing_file<VALUE: Into<bool>>( &mut self, value: VALUE ) -> &mut Self

If file does not exists do not try to load it. The default Value will be returned. Default is false.

source

pub fn loader<VALUE: Into<L>>(&mut self, value: VALUE) -> &mut Self

Set the loader structure which implements Load trait.

source

pub fn build(&self) -> Result<FileParser<L>, FileParserBuilderError>

Builds a new FileParser.

Errors

If a required field has not been initialized.

Trait Implementations§

source§

impl<L: Clone + Load + Default> Clone for FileParserBuilder<L>

source§

fn clone(&self) -> FileParserBuilder<L>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<L: Load + Default + Clone> Default for FileParserBuilder<L>

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<L> RefUnwindSafe for FileParserBuilder<L>
where L: RefUnwindSafe,

§

impl<L> Send for FileParserBuilder<L>
where L: Send,

§

impl<L> Sync for FileParserBuilder<L>
where L: Sync,

§

impl<L> Unpin for FileParserBuilder<L>
where L: Unpin,

§

impl<L> UnwindSafe for FileParserBuilder<L>
where L: UnwindSafe,

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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

§

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.