pub struct FormatTable { /* private fields */ }Expand description
The format table for key=value pairs used when rendering Arguments, like in format()
Implementations§
Source§impl FormatTable
impl FormatTable
Sourcepub fn render(&self, template: &Template<'_>) -> String
pub fn render(&self, template: &Template<'_>) -> String
Renders a template to a string, replacing tags with values from the table
pub fn render_string( &self, str: impl AsRef<str>, ) -> Result<String, TemplateError>
Sourcepub fn add_entry(&mut self, key: impl Into<String>, value: impl Into<String>)
pub fn add_entry(&mut self, key: impl Into<String>, value: impl Into<String>)
Adds a single key=value pair to the table
Sourcepub fn add_table<I, K, V>(&mut self, table: I)
pub fn add_table<I, K, V>(&mut self, table: I)
Extends the table with an iterator of key=value pairs
Trait Implementations§
Source§impl Clone for FormatTable
impl Clone for FormatTable
Source§fn clone(&self) -> FormatTable
fn clone(&self) -> FormatTable
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 moreSource§impl Debug for FormatTable
impl Debug for FormatTable
Source§impl Default for FormatTable
impl Default for FormatTable
Source§fn default() -> FormatTable
fn default() -> FormatTable
Returns the “default value” for a type. Read more
impl Eq for FormatTable
Source§impl<I, K, V> From<I> for FormatTable
impl<I, K, V> From<I> for FormatTable
Source§impl<K, V> FromIterator<(K, V)> for FormatTable
impl<K, V> FromIterator<(K, V)> for FormatTable
Source§impl PartialEq for FormatTable
impl PartialEq for FormatTable
impl StructuralPartialEq for FormatTable
Source§impl Taggable for FormatTable
impl Taggable for FormatTable
type Err = Infallible
fn fill_table(&self, table: &mut FormatTable) -> Result<(), Infallible>
Auto Trait Implementations§
impl Freeze for FormatTable
impl RefUnwindSafe for FormatTable
impl Send for FormatTable
impl Sync for FormatTable
impl Unpin for FormatTable
impl UnsafeUnpin for FormatTable
impl UnwindSafe for FormatTable
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more