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§
Sourcefn escape(f: &mut Formatter<'_>, s: &str) -> Result<(), Error>
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.
Sourcefn this_format() -> Self
fn this_format() -> Self
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.