Trait Format

Source
pub trait Format:
    Sync
    + Send
    + Copy
    + Eq
    + Ord
    + Hash {
    // Required methods
    fn escape(f: &mut Formatter<'_>, s: &str) -> Result<(), Error>;
    fn mime() -> Mime;
    fn this_format() -> Self;
}
Expand description

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

Required Methods§

Source

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.

Source

fn mime() -> Mime

The mime type of this format.

Source

fn this_format() -> Self

Return an actual Format for use in As below.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§