Struct marked_yaml::loader::LoaderOptions
source · pub struct LoaderOptions { /* private fields */ }
Expand description
Implementations§
source§impl LoaderOptions
impl LoaderOptions
sourcepub fn error_on_duplicate_keys(self, enable: bool) -> Self
pub fn error_on_duplicate_keys(self, enable: bool) -> Self
Enable errors on duplicate keys
If enabled, duplicate keys in mappings will cause an error. If disabled, the last key/value pair will be used.
sourcepub fn prevent_coercion(self, prevent: bool) -> Self
pub fn prevent_coercion(self, prevent: bool) -> Self
Prevent coercion of scalar nodes
If you want to disable things like .as_bool()
then you can call this and set coercion to be prevented.
sourcepub fn toplevel_mapping(self) -> Self
pub fn toplevel_mapping(self) -> Self
Require that the top level is a mapping node
This is the default, but you can call this to be explicit.
sourcepub fn toplevel_sequence(self) -> Self
pub fn toplevel_sequence(self) -> Self
Require that the top level is a sequence node
Without calling this, the top level of the YAML is must be a mapping node
sourcepub fn lowercase_keys(self, force_lowercase: bool) -> Self
pub fn lowercase_keys(self, force_lowercase: bool) -> Self
Whether or not to force-lowercase mapping keys when loading
By default, the loader will leave key names alone, but in some cases it can be preferable to normalise them to lowercase
Trait Implementations§
source§impl Debug for LoaderOptions
impl Debug for LoaderOptions
Auto Trait Implementations§
impl Freeze for LoaderOptions
impl RefUnwindSafe for LoaderOptions
impl Send for LoaderOptions
impl Sync for LoaderOptions
impl Unpin for LoaderOptions
impl UnwindSafe for LoaderOptions
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