Trait pfmt::FormatTable
source · pub trait FormatTable {
fn get_fmt<'a, 'b>(&'a self, name: &'b str) -> Option<BoxOrRef<'a, dyn Fmt>>;
fn format(&self, input: &str) -> Result<String, FormattingError> { ... }
}
Expand description
A collection or producer of format units.
Required Methods
Provided Methods
Implementations on Foreign Types
sourceimpl<'a, T: FormatTable> FormatTable for &'a T
impl<'a, T: FormatTable> FormatTable for &'a T
sourceimpl<B: Borrow<dyn Fmt>> FormatTable for HashMap<String, B>
impl<B: Borrow<dyn Fmt>> FormatTable for HashMap<String, B>
This implementation recognizes placeholders with string names stored in the hash map.
sourceimpl<'a, B: Borrow<dyn Fmt>> FormatTable for HashMap<&'a str, B>
impl<'a, B: Borrow<dyn Fmt>> FormatTable for HashMap<&'a str, B>
This implementation recognizes placeholders with string names (represented by string slices) stored in the hash map.
sourceimpl<B: Borrow<dyn Fmt>> FormatTable for Vec<B>
impl<B: Borrow<dyn Fmt>> FormatTable for Vec<B>
This implementation recognizes placeholders which names are valid integer indices into the vector.
sourceimpl<A, B> FormatTable for (A, B)where
A: FormatTable,
B: FormatTable,
impl<A, B> FormatTable for (A, B)where
A: FormatTable,
B: FormatTable,
This implementation first uses the first table to look up placeholders’ names, and then the second.
sourceimpl<A, B, C> FormatTable for (A, B, C)where
A: FormatTable,
B: FormatTable,
C: FormatTable,
impl<A, B, C> FormatTable for (A, B, C)where
A: FormatTable,
B: FormatTable,
C: FormatTable,
This implementation looks up placeholders’ names consecutively in three other tables.
sourceimpl<A, B, C, D> FormatTable for (A, B, C, D)where
A: FormatTable,
B: FormatTable,
C: FormatTable,
D: FormatTable,
impl<A, B, C, D> FormatTable for (A, B, C, D)where
A: FormatTable,
B: FormatTable,
C: FormatTable,
D: FormatTable,
This implementation looks up placeholders’ names consecutively in four other tables.
sourceimpl<A, B, C, D, E> FormatTable for (A, B, C, D, E)where
A: FormatTable,
B: FormatTable,
C: FormatTable,
D: FormatTable,
E: FormatTable,
impl<A, B, C, D, E> FormatTable for (A, B, C, D, E)where
A: FormatTable,
B: FormatTable,
C: FormatTable,
D: FormatTable,
E: FormatTable,
This implementation looks up placeholders’ names consecutively in five other tables.
sourceimpl<A, B, C, D, E, F> FormatTable for (A, B, C, D, E, F)where
A: FormatTable,
B: FormatTable,
C: FormatTable,
D: FormatTable,
E: FormatTable,
F: FormatTable,
impl<A, B, C, D, E, F> FormatTable for (A, B, C, D, E, F)where
A: FormatTable,
B: FormatTable,
C: FormatTable,
D: FormatTable,
E: FormatTable,
F: FormatTable,
This implementation looks up placeholders’ names consecutively in six other tables.