Enum minijinja::UndefinedBehavior
source · #[non_exhaustive]pub enum UndefinedBehavior {
Lenient,
Chainable,
Strict,
}
Expand description
Defines the behavior of undefined values in the engine.
At present there are three types of behaviors available which mirror the behaviors that Jinja2 provides out of the box.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Lenient
The default, somewhat lenient undefined behavior.
- printing: allowed (returns empty string)
- iteration: allowed (returns empty array)
- attribute access of undefined values: fails
Chainable
Like Lenient
, but also allows chaining of undefined lookups.
- printing: allowed (returns empty string)
- iteration: allowed (returns empty array)
- attribute access of undefined values: allowed (returns
undefined
)
Strict
Complains very quickly about undefined values.
- printing: fails
- iteration: fails
- attribute access of undefined values: fails
Trait Implementations§
source§impl Clone for UndefinedBehavior
impl Clone for UndefinedBehavior
source§fn clone(&self) -> UndefinedBehavior
fn clone(&self) -> UndefinedBehavior
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for UndefinedBehavior
impl Debug for UndefinedBehavior
source§impl Default for UndefinedBehavior
impl Default for UndefinedBehavior
source§fn default() -> UndefinedBehavior
fn default() -> UndefinedBehavior
Returns the “default value” for a type. Read more
source§impl PartialEq for UndefinedBehavior
impl PartialEq for UndefinedBehavior
source§fn eq(&self, other: &UndefinedBehavior) -> bool
fn eq(&self, other: &UndefinedBehavior) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for UndefinedBehavior
impl Eq for UndefinedBehavior
impl StructuralPartialEq for UndefinedBehavior
Auto Trait Implementations§
impl Freeze for UndefinedBehavior
impl RefUnwindSafe for UndefinedBehavior
impl Send for UndefinedBehavior
impl Sync for UndefinedBehavior
impl Unpin for UndefinedBehavior
impl UnwindSafe for UndefinedBehavior
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)