Trait pfmt::FormatTable[][src]

pub trait FormatTable {
    fn get_fmt(&self, name: &str) -> Option<&Fmt>;

    fn produce_fmt(&self, _name: &str) -> Option<Box<Fmt>> { ... }
fn format(&self, input: &str) -> Result<String, FormattingError> { ... } }

Objects implementing this trait drive the formatting process by supplying information to the contained or produced Fmts.

The main method you should supply if you want to create your own implementation is get_fmt, which should produce a reference to a Fmt that the table holds, or None if there's no Fmt with the supplied name (what is a name is entirely up to you. Whatever you can comfortably encode in a string is fine).

produce_fmt is called when a Fmt with the supplied name could not be found, and should create such a Fmt if it can, or return None if it can't.

The main method for formatting is format.

Required Methods

Provided Methods

Implementations on Foreign Types

impl<'a, T: FormatTable + ?Sized> FormatTable for &'a T
[src]

impl<B: Borrow<Fmt>> FormatTable for HashMap<String, B>
[src]

impl<'a, B: Borrow<Fmt>> FormatTable for HashMap<&'a str, B>
[src]

impl<B: Borrow<Fmt>> FormatTable for Vec<B>
[src]

impl<A, B> FormatTable for (A, B) where
    A: FormatTable,
    B: FormatTable
[src]

impl<A, B, C> FormatTable for (A, B, C) where
    A: FormatTable,
    B: FormatTable,
    C: FormatTable
[src]

impl<A, B, C, D> FormatTable for (A, B, C, D) where
    A: FormatTable,
    B: FormatTable,
    C: FormatTable,
    D: FormatTable
[src]

impl<A, B, C, D, E> FormatTable for (A, B, C, D, E) where
    A: FormatTable,
    B: FormatTable,
    C: FormatTable,
    D: FormatTable,
    E: FormatTable
[src]

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
[src]

Implementors