Trait DisplayAs

Source
pub trait DisplayAs<F: Format> {
    // Required method
    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>;

    // Provided methods
    fn estimate_size(&self) -> usize { ... }
    fn display<'a>(&'a self) -> As<'a, F, Self> { ... }
}
Expand description

This trait is analogous to Display, but will display the data in F Format.

Required Methods§

Source

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter.

Provided Methods§

Source

fn estimate_size(&self) -> usize

Estimate the size of this when displayed

Source

fn display<'a>(&'a self) -> As<'a, F, Self>

Creates a display object

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.

Implementations on Foreign Types§

Source§

impl DisplayAs<HTML> for f32

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<HTML> for f64

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<HTML> for i8

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<HTML> for i16

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<HTML> for i32

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<HTML> for i64

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<HTML> for i128

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<HTML> for isize

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<HTML> for u8

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<HTML> for u16

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<HTML> for u32

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<HTML> for u64

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<HTML> for u128

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<HTML> for usize

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<LaTeX> for f32

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<LaTeX> for f64

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<LaTeX> for i8

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<LaTeX> for i16

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<LaTeX> for i32

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<LaTeX> for i64

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<LaTeX> for i128

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<LaTeX> for isize

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<LaTeX> for u8

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<LaTeX> for u16

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<LaTeX> for u32

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<LaTeX> for u64

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<LaTeX> for u128

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<LaTeX> for usize

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<Math> for f32

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<Math> for f64

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<Math> for i8

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<Math> for i16

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<Math> for i32

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<Math> for i64

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<Math> for i128

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<Math> for isize

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<Math> for u8

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<Math> for u16

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<Math> for u32

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<Math> for u64

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<Math> for u128

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<Math> for usize

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<Rust> for f32

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<Rust> for f64

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<Rust> for i8

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<Rust> for i16

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<Rust> for i32

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<Rust> for i64

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<Rust> for i128

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<Rust> for isize

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<Rust> for u8

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<Rust> for u16

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<Rust> for u32

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<Rust> for u64

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<Rust> for u128

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<Rust> for usize

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<URL> for f32

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<URL> for f64

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<URL> for i8

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<URL> for i16

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<URL> for i32

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<URL> for i64

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<URL> for i128

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<URL> for isize

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<URL> for u8

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<URL> for u16

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<URL> for u32

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<URL> for u64

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<URL> for u128

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<URL> for usize

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<UTF8> for f32

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<UTF8> for f64

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<UTF8> for i8

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<UTF8> for i16

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<UTF8> for i32

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<UTF8> for i64

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<UTF8> for i128

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<UTF8> for isize

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<UTF8> for u8

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<UTF8> for u16

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<UTF8> for u32

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<UTF8> for u64

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<UTF8> for u128

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl DisplayAs<UTF8> for usize

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl<'a, F: Format> DisplayAs<F> for &'a str

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl<'a, F: Format> DisplayAs<F> for &'a String

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl<F: Format> DisplayAs<F> for str

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Source§

impl<F: Format> DisplayAs<F> for String

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Implementors§