pub struct SurrogatePair { /* private fields */ }Expand description
A two-code-unit UTF-16 sequence
A high surrogate followed by a low surrogate representing a Unicode scalar value outside the Basic Multilingual Plane.
Implementations§
Source§impl SurrogatePair
impl SurrogatePair
Sourcepub const fn new(high: HighSurrogate, low: LowSurrogate) -> Self
pub const fn new(high: HighSurrogate, low: LowSurrogate) -> Self
Constructor from a high surrogate and a low surrogate
Sourcepub const fn to_typed_code_units(self) -> (HighSurrogate, LowSurrogate)
pub const fn to_typed_code_units(self) -> (HighSurrogate, LowSurrogate)
Convert to typed code unit tuple.
Sourcepub const fn as_code_units(&self) -> &[u16; 2]
pub const fn as_code_units(&self) -> &[u16; 2]
Trait Implementations§
Source§impl AsRef<[u16]> for SurrogatePair
impl AsRef<[u16]> for SurrogatePair
Source§impl Clone for SurrogatePair
impl Clone for SurrogatePair
impl Copy for SurrogatePair
Source§impl Debug for SurrogatePair
impl Debug for SurrogatePair
impl Eq for SurrogatePair
Source§impl From<SurrogatePair> for char
impl From<SurrogatePair> for char
Source§fn from(surrogate_pair: SurrogatePair) -> Self
fn from(surrogate_pair: SurrogatePair) -> Self
Converts to this type from the input type.
Source§impl Hash for SurrogatePair
impl Hash for SurrogatePair
Source§impl Ord for SurrogatePair
impl Ord for SurrogatePair
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for SurrogatePair
impl PartialEq for SurrogatePair
Source§impl PartialOrd for SurrogatePair
impl PartialOrd for SurrogatePair
impl StructuralPartialEq for SurrogatePair
impl Utf16CodeUnitSequence for SurrogatePair
Auto Trait Implementations§
impl Freeze for SurrogatePair
impl RefUnwindSafe for SurrogatePair
impl Send for SurrogatePair
impl Sync for SurrogatePair
impl Unpin for SurrogatePair
impl UnsafeUnpin for SurrogatePair
impl UnwindSafe for SurrogatePair
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