pub struct HighSurrogate { /* private fields */ }Expand description
A high surrogate
Implementations§
Source§impl HighSurrogate
impl HighSurrogate
Sourcepub const fn is(code_unit: u16) -> bool
pub const fn is(code_unit: u16) -> bool
Whether code_unit is a high surrogate.
§Safety-usable invariant
Iff this method returns true, the safety invariant of new_unchecked()
is satisfied.
Sourcepub const unsafe fn new_unchecked(code_unit: u16) -> Self
pub const unsafe fn new_unchecked(code_unit: u16) -> Self
Sourcepub const fn try_new(code_unit: u16) -> Result<Self, Utf16CodeUnitError>
pub const fn try_new(code_unit: u16) -> Result<Self, Utf16CodeUnitError>
Fallible constructor
Ok if high surrogate and Err otherwise.
Sourcepub const fn to_surrogate(self) -> Surrogate
pub const fn to_surrogate(self) -> Surrogate
Convert to Surrogate
Sourcepub const fn try_new_with_surrogate(
surrogate: Surrogate,
) -> Result<Self, Utf16CodeUnitError>
pub const fn try_new_with_surrogate( surrogate: Surrogate, ) -> Result<Self, Utf16CodeUnitError>
Fallible constructor given a surrogate
Ok if high surrogate and Err otherwise.
Trait Implementations§
Source§impl Clone for HighSurrogate
impl Clone for HighSurrogate
impl Copy for HighSurrogate
Source§impl Debug for HighSurrogate
impl Debug for HighSurrogate
impl Eq for HighSurrogate
Source§impl From<HighSurrogate> for u16
impl From<HighSurrogate> for u16
Source§fn from(high_surrogate: HighSurrogate) -> Self
fn from(high_surrogate: HighSurrogate) -> Self
Converts to this type from the input type.
Source§impl Hash for HighSurrogate
impl Hash for HighSurrogate
Source§impl Ord for HighSurrogate
impl Ord for HighSurrogate
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 HighSurrogate
impl PartialEq for HighSurrogate
Source§impl PartialOrd for HighSurrogate
impl PartialOrd for HighSurrogate
impl StructuralPartialEq for HighSurrogate
Source§impl TryFrom<u16> for HighSurrogate
impl TryFrom<u16> for HighSurrogate
Source§type Error = Utf16CodeUnitError
type Error = Utf16CodeUnitError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for HighSurrogate
impl RefUnwindSafe for HighSurrogate
impl Send for HighSurrogate
impl Sync for HighSurrogate
impl Unpin for HighSurrogate
impl UnsafeUnpin for HighSurrogate
impl UnwindSafe for HighSurrogate
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