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