pub enum FormatStyle {
Printf,
StrFormat,
}Available on crate feature
builtins only.Expand description
Controls the style of the format string.
Like jinja2, minijinja supports two styles of string formatting:
- printf-style:
{{ "%s, %s!"|format(greeting, name) }} str.format()style:{{ "{}, {}!".format(greeting, name) }}
The format_filter function implements both the styles, and you can invoke a
particular style of formatting by passing this enum as an argument.
Variants§
Printf
Printf-style format string, described here
StrFormat
str.format() style format string, described
here
Trait Implementations§
Source§impl Clone for FormatStyle
impl Clone for FormatStyle
Source§fn clone(&self) -> FormatStyle
fn clone(&self) -> FormatStyle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for FormatStyle
Source§impl Debug for FormatStyle
impl Debug for FormatStyle
impl Eq for FormatStyle
Source§impl PartialEq for FormatStyle
impl PartialEq for FormatStyle
impl StructuralPartialEq for FormatStyle
Auto Trait Implementations§
impl Freeze for FormatStyle
impl RefUnwindSafe for FormatStyle
impl Send for FormatStyle
impl Sync for FormatStyle
impl Unpin for FormatStyle
impl UnsafeUnpin for FormatStyle
impl UnwindSafe for FormatStyle
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