Trait DisplayExt

Source
pub trait DisplayExt<D> {
    // Provided method
    fn display(&self) -> Carrier<'_, Self, D> { ... }
}
Expand description

A trait extension which adds a method like Path::display does this for any type. Its method returns an object that implements Display and can be used for formatting.

Provided Methods§

Source

fn display(&self) -> Carrier<'_, Self, D>

Returns a wrapper that implements Display via CustomDisplay.

Examples found in repository?
examples/custom_display.rs (line 26)
24fn main() {
25    let foo = ExternCrateType(42);
26    println!("{}", foo.display());
27}

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, D> DisplayExt<D> for T
where T: AttachDisplay<D> + ?Sized,