pub struct Surrogate { /* private fields */ }Expand description
A single surrogate code unit, which can be a high surrogate or a low surrogate
Implementations§
Source§impl Surrogate
impl Surrogate
Sourcepub const fn is(code_unit: u16) -> bool
pub const fn is(code_unit: u16) -> bool
Whether code_unit is a 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 surrogate and Err otherwise.
Trait Implementations§
impl Copy for Surrogate
impl Eq for Surrogate
Source§impl Ord for Surrogate
impl Ord for Surrogate
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 PartialOrd for Surrogate
impl PartialOrd for Surrogate
impl StructuralPartialEq for Surrogate
Auto Trait Implementations§
impl Freeze for Surrogate
impl RefUnwindSafe for Surrogate
impl Send for Surrogate
impl Sync for Surrogate
impl Unpin for Surrogate
impl UnsafeUnpin for Surrogate
impl UnwindSafe for Surrogate
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