pub struct Display<'a> {
inner: Display<'a>,
}
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());
Fields§
§inner: Display<'a>
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Display<'a>
impl<'a> RefUnwindSafe for Display<'a>
impl<'a> Send for Display<'a>
impl<'a> Sync for Display<'a>
impl<'a> Unpin for Display<'a>
impl<'a> UnwindSafe for Display<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more