Skip to main content

DisplayExt

Trait DisplayExt 

Source
pub trait DisplayExt {
    // Required methods
    fn is_empty(&self) -> bool;
    fn write_to_fmt<W>(&self, writer: W) -> Result<(), Error>
       where W: Write;
    fn write_to_bytes<W>(&self, writer: W) -> Result<(), Error>
       where W: Write;
    fn format_with<F>(&self, f: F) -> Result<(), Error>
       where F: FnMut(Option<&str>) -> Result<(), Error>;

    // Provided methods
    fn try_to_fmt<T>(&self) -> Result<T, T>
       where T: Write + Default { ... }
    fn try_to_bytes<T>(&self) -> Result<T, T>
       where T: Write + Default { ... }
    fn to_fmt<T>(&self) -> T
       where T: Write + Default { ... }
    fn to_bytes<T>(&self) -> T
       where T: Write + Default { ... }
}

Required Methods§

Source

fn is_empty(&self) -> bool

Source

fn write_to_fmt<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Source

fn write_to_bytes<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Source

fn format_with<F>(&self, f: F) -> Result<(), Error>
where F: FnMut(Option<&str>) -> Result<(), Error>,

Provided Methods§

Source

fn try_to_fmt<T>(&self) -> Result<T, T>
where T: Write + Default,

Source

fn try_to_bytes<T>(&self) -> Result<T, T>
where T: Write + Default,

Source

fn to_fmt<T>(&self) -> T
where T: Write + Default,

Source

fn to_bytes<T>(&self) -> T
where T: Write + Default,

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§

Source§

impl<T> DisplayExt for T
where T: Display + ?Sized,