pub struct Display<'a, T>where
T: Encoding,{ /* private fields */ }
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 typed_path::{Path, UnixEncoding};
// NOTE: A path cannot be created on its own without a defined encoding
let path = Path::<UnixEncoding>::new("/tmp/foo.rs");
println!("{}", path.display());
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for Display<'a, T>
impl<'a, T> RefUnwindSafe for Display<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for Display<'a, T>where
T: Sync,
impl<'a, T> Sync for Display<'a, T>where
T: Sync,
impl<'a, T> Unpin for Display<'a, T>
impl<'a, T> UnwindSafe for Display<'a, T>where
T: RefUnwindSafe,
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