pub struct LowSurrogate { /* private fields */ }Expand description
A low surrogate
Implementations§
Source§impl LowSurrogate
impl LowSurrogate
Sourcepub const fn is(code_unit: u16) -> bool
pub const fn is(code_unit: u16) -> bool
Whether code_unit is a low 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 low 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 low surrogate and Err otherwise.
Trait Implementations§
Source§impl Clone for LowSurrogate
impl Clone for LowSurrogate
impl Copy for LowSurrogate
Source§impl Debug for LowSurrogate
impl Debug for LowSurrogate
impl Eq for LowSurrogate
Source§impl From<LowSurrogate> for u16
impl From<LowSurrogate> for u16
Source§fn from(low_surrogate: LowSurrogate) -> Self
fn from(low_surrogate: LowSurrogate) -> Self
Converts to this type from the input type.
Source§impl Hash for LowSurrogate
impl Hash for LowSurrogate
Source§impl Ord for LowSurrogate
impl Ord for LowSurrogate
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 LowSurrogate
impl PartialEq for LowSurrogate
Source§impl PartialOrd for LowSurrogate
impl PartialOrd for LowSurrogate
impl StructuralPartialEq for LowSurrogate
Source§impl TryFrom<u16> for LowSurrogate
impl TryFrom<u16> for LowSurrogate
Source§type Error = Utf16CodeUnitError
type Error = Utf16CodeUnitError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for LowSurrogate
impl RefUnwindSafe for LowSurrogate
impl Send for LowSurrogate
impl Sync for LowSurrogate
impl Unpin for LowSurrogate
impl UnsafeUnpin for LowSurrogate
impl UnwindSafe for LowSurrogate
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