Struct std::path::Display1.0.0[][src]

pub struct Display<'a> { /* fields omitted */ }
Expand description

Helper struct for safely printing paths with format! and {}.

A Path might contain non-Unicode data. This struct implements the Display trait in a way that mitigates that. It is created by the display method on Path. This may perform lossy conversion, depending on the platform. If you would like an implementation which escapes the path please use Debug instead.

Examples

use std::path::Path;

let path = Path::new("/tmp/foo.rs");

println!("{}", path.display());
Run

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.