pub struct Display<'a> { /* private fields */ }
🔬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());
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> Also for T
impl<T> Also for T
source§impl<T, Res> Apply<Res> for Twhere
T: ?Sized,
impl<T, Res> Apply<Res> for Twhere
T: ?Sized,
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
source§impl<T> ByteSized for T
impl<T> ByteSized for T
source§const BYTE_ALIGN: usize = _
const BYTE_ALIGN: usize = _
The alignment of this type in bytes.
source§const LITTLE_ENDIAN: bool = true
const LITTLE_ENDIAN: bool = true
True if the system’s architecture is little-endian.
source§const BIG_ENDIAN: bool = false
const BIG_ENDIAN: bool = false
True if the system’s architecture is big-endian.
source§fn byte_align(&self) -> usize ⓘ
fn byte_align(&self) -> usize ⓘ
Returns the alignment of this type in bytes.
source§impl<T> ExtAny for T
impl<T> ExtAny for T
source§fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
source§impl<T> ExtMem for Twhere
T: ?Sized,
impl<T> ExtMem for Twhere
T: ?Sized,
source§const NEEDS_DROP: bool = _
const NEEDS_DROP: bool = _
Know whether dropping values of this type matters, in compile-time.
source§fn mem_needs_drop(&self) -> bool
fn mem_needs_drop(&self) -> bool
Returns
true
if dropping values of this type matters. Read moresource§fn mem_forget(self)where
Self: Sized,
fn mem_forget(self)where
Self: Sized,
Forgets about
self
without running its destructor. Read moresource§fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
source§fn mem_as_bytes(&self) -> &[u8] ⓘ
fn mem_as_bytes(&self) -> &[u8] ⓘ
Available on crate feature
unsafe_slice
only.