[][src]Trait display_as::Format

pub trait Format {
    fn escape(f: &mut Formatter, s: &str) -> Result<(), Error>;
fn mime() -> Mime;
fn this_format() -> Self; }

Format is a format that we can use for displaying data.

Required methods

fn escape(f: &mut Formatter, s: &str) -> Result<(), Error>

"Escape" the given string so it can be safely displayed in this format. The precise meaning of this may vary from format to format, but the general sense is that this string does not have any internal formatting, and must be displayed appropriately.

fn mime() -> Mime

The mime type of this format.

fn this_format() -> Self

Return an actual Format for use in As below.

Loading content...

Implementors

impl Format for HTML[src]

fn mime() -> Mime[src]

The MIME type for HTML is mime::TEXT_HTML_UTF_8.

impl Format for LaTeX[src]

impl Format for Math[src]

impl Format for Rust[src]

impl Format for URL[src]

fn mime() -> Mime[src]

The MIME type for URL is [mime::TEXT_URL_UTF_8].

impl Format for UTF8[src]

Loading content...