pub enum Wtf8 {}Expand description
The WTF-8 encoding: arbitrary, ill-formed-tolerant WTF-8 stored as u8 code
units – the byte representation a Windows OsStr uses.
It matches OsString’s WTF-8 layout but is not built on OsString (D-3): the
storage is a crate-owned Vec<u8>. Construction from units performs no
validation, so the bytes may be well-formed WTF-8 (including encoded
surrogates) or arbitrary. Like Wtf16 it is a pure type-level marker and is
never constructed.
Trait Implementations§
Source§impl WtfEncoding for Wtf8
impl WtfEncoding for Wtf8
Source§const NUL: u8 = 0
const NUL: u8 = 0
The NUL code unit (
U+0000) used as the always-present buffer terminator. Read moreSource§fn decode(units: &[u8]) -> Option<String>
fn decode(units: &[u8]) -> Option<String>
Decode content code units to a
String if they are well-formed for this
encoding, or None if they are ill-formed (e.g. an unpaired surrogate),
which a strict String cannot represent.Source§fn decode_lossy(units: &[u8]) -> String
fn decode_lossy(units: &[u8]) -> String
Decode content code units to a
String, replacing any ill-formed sequence
with the Unicode replacement character (U+FFFD).Auto Trait Implementations§
impl Freeze for Wtf8
impl RefUnwindSafe for Wtf8
impl Send for Wtf8
impl Sync for Wtf8
impl Unpin for Wtf8
impl UnsafeUnpin for Wtf8
impl UnwindSafe for Wtf8
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