pub struct Display<'a> {
os_str: &'a OsStr,
}
๐ฌThis is a nightly-only experimental API. (
os_str_display
)Expand description
Helper struct for safely printing an OsStr
with format!
and {}
.
An OsStr
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 OsStr
. This may perform lossy
conversion, depending on the platform. If you would like an implementation
which escapes the OsStr
please use Debug
instead.
ยงExamples
#![feature(os_str_display)]
use std::ffi::OsStr;
let s = OsStr::new("Hello, world!");
println!("{}", s.display());
Fieldsยง
ยงos_str: &'a OsStr
๐ฌThis is a nightly-only experimental API. (
os_str_display
)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