#[repr(transparent)]pub struct PotentialUtf16(pub [u16]);Expand description
A u16 slice that is expected to be a UTF-16 string but does not enforce that invariant.
See PotentialUtf8 for more info.
Tuple Fields§
§0: [u16]Implementations§
Source§impl PotentialUtf16
impl PotentialUtf16
Sourcepub const fn from_slice(other: &[u16]) -> &Self
pub const fn from_slice(other: &[u16]) -> &Self
Create a PotentialUtf16 from a u16 slice.
Sourcepub fn chars(&self) -> impl Iterator<Item = char> + '_
pub fn chars(&self) -> impl Iterator<Item = char> + '_
Iterates the characters of the string.
Returns char::REPLACEMENT_CHARACTER if invalid surrogates are encountered.
Trait Implementations§
Source§impl Debug for PotentialUtf16
impl Debug for PotentialUtf16
Source§impl Ord for PotentialUtf16
impl Ord for PotentialUtf16
Source§impl PartialEq for PotentialUtf16
impl PartialEq for PotentialUtf16
Source§fn eq(&self, other: &PotentialUtf16) -> bool
fn eq(&self, other: &PotentialUtf16) -> bool
Tests for
self and other values to be equal, and is used by ==.