Struct barkml::StandardLoader

source ·
pub struct StandardLoader { /* private fields */ }
Expand description

Loader can be used to load a single or directory of configuration files with user control

Implementations§

source§

impl StandardLoader

source

pub fn path<P>(&mut self, path: P) -> Result<&mut Self>
where P: AsRef<Path>,

Add a path to this loader

source

pub fn source(&mut self, input: &str) -> Result<&mut Self>

Adds an inline string as a configuration module

Trait Implementations§

source§

impl Default for StandardLoader

source§

fn default() -> Self

Create a new loader with the default settings which is: mode = Single allow_collisions = false resolve_macros = true

source§

impl Loader for StandardLoader

source§

fn mode(&mut self, mode: LoaderMode) -> Result<&mut Self>

Set the loader mode to use

source§

fn allow_collisions(&mut self) -> Result<&mut Self>

When merging or appending multiple files together tell the loader to allow collisions and overwrite the first found one with the next

source§

fn read(&self) -> Result<Value>

Load all the configuration files and return everything as a single module

source§

fn is_resolution_enabled(&self) -> bool

source§

fn is_collision_allowed(&self) -> bool

source§

fn skip_macro_resolution(&mut self) -> Result<&mut Self>

source§

fn macro_resolution(&self, module: &Value) -> Result<Value>

source§

fn load(&self) -> Result<Value>

source§

fn merge_into(&self, left: &mut Value, right: &Value) -> Result<()>

Auto Trait Implementations§

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

§

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.