pub enum MissingValuePolicy {
Error,
Empty,
KeepPlaceholder,
}Expand description
Policy for handling missing values during rendering.
Controls what happens when a variable path (e.g., {{user.missing}})
resolves to None in the context.
Variants§
Error
Return an error when a variable is missing.
This is the default behavior, providing fail-fast validation that all required template variables are present in the context.
Empty
Replace missing variables with empty string.
Use when optional variables should render as blank text rather than failing the entire render operation.
KeepPlaceholder
Keep the original placeholder text.
Use when you want to preserve {{variable}} syntax in the output
for variables that are not found in the context.
Trait Implementations§
Source§impl Clone for MissingValuePolicy
impl Clone for MissingValuePolicy
impl Copy for MissingValuePolicy
Source§impl Debug for MissingValuePolicy
impl Debug for MissingValuePolicy
impl Eq for MissingValuePolicy
Source§impl PartialEq for MissingValuePolicy
impl PartialEq for MissingValuePolicy
impl StructuralPartialEq for MissingValuePolicy
Auto Trait Implementations§
impl Forget for MissingValuePolicy
impl Freeze for MissingValuePolicy
impl Move for MissingValuePolicy
impl RefUnwindSafe for MissingValuePolicy
impl Send for MissingValuePolicy
impl Sync for MissingValuePolicy
impl Unpin for MissingValuePolicy
impl UnsafeUnpin for MissingValuePolicy
impl UnwindSafe for MissingValuePolicy
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.