#[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§impl PartialOrd for PotentialUtf16
impl PartialOrd for PotentialUtf16
Source§impl TryWriteable for &PotentialUtf16
This impl requires enabling the optional writeable Cargo feature
impl TryWriteable for &PotentialUtf16
This impl requires enabling the optional writeable Cargo feature
type Error = DecodeUtf16Error
Source§fn try_write_to_parts<S: PartsWrite + ?Sized>(
&self,
sink: &mut S,
) -> Result<Result<(), Self::Error>, Error>
fn try_write_to_parts<S: PartsWrite + ?Sized>( &self, sink: &mut S, ) -> Result<Result<(), Self::Error>, Error>
Writes the content of this writeable to a sink with parts (annotations). Read more
Source§fn writeable_length_hint(&self) -> LengthHint
fn writeable_length_hint(&self) -> LengthHint
Returns a hint for the number of UTF-8 bytes that will be written to the sink. Read more