#[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
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