Trait DisplayExt

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

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

Required Methods§

Source

fn is_empty(&self) -> bool

Source

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

Source

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

Source

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

Provided Methods§

Source

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

Source

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

Source

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

Source

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

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,