pub struct char16(/* private fields */);
_char16
only.Expand description
A 16-bit unicode scalar, limited to the Basic Multilingual Plane subset.
It can represent every scalar from the Basic Multilingual Plane (BMP), the first and most important plane in the Unicode standard (also known as plane 0), containing nearly all commonly used writing systems and symbols.
Option<char16>
is the same size as char16
(2 bytes).
Implementations§
Source§impl char16
impl char16
Sourcepub const MAX: char16
pub const MAX: char16
The highest unicode scalar a char16
can represent, '\u{FFFF}'
.
Note that '\u{FFFF}'
is a noncharacter.
Sourcepub const REPLACEMENT_CHARACTER: char16
pub const REPLACEMENT_CHARACTER: char16
U+FFFD REPLACEMENT CHARACTER (�)
is used in Unicode to represent a decoding error.
Sourcepub const fn from_ascii_char(c: AsciiChar) -> char16
Available on crate feature ascii
only.
pub const fn from_ascii_char(c: AsciiChar) -> char16
ascii
only.Converts an AsciiChar
to char16
.
Sourcepub const fn from_char7(c: char7) -> char16
Available on crate feature _char7
only.
pub const fn from_char7(c: char7) -> char16
_char7
only.Converts a char7
to char16
.
Sourcepub const fn from_char8(c: char8) -> char16
Available on crate feature _char8
only.
pub const fn from_char8(c: char8) -> char16
_char8
only.Converts a char8
to char16
.
Sourcepub const fn try_from_char(c: char) -> Result<char16, DataOverflow> ⓘ
pub const fn try_from_char(c: char) -> Result<char16, DataOverflow> ⓘ
Tries to convert a char
to char16
.
§Errors
Returns DataOverflow
if the character can’t fit in 16 bits.
Sourcepub const fn try_to_ascii_char(self) -> Result<AsciiChar, DataOverflow> ⓘ
Available on crate feature ascii
only.
pub const fn try_to_ascii_char(self) -> Result<AsciiChar, DataOverflow> ⓘ
ascii
only.Tries to convert this char16
to AsciiChar
.
§Errors
Returns DataOverflow
if self
can’t fit in 7 bits.
§Features
Makes use of the unsafe_niche
feature if enabled.
Sourcepub const fn try_to_char7(self) -> Result<char7, DataOverflow> ⓘ
Available on crate feature _char7
only.
pub const fn try_to_char7(self) -> Result<char7, DataOverflow> ⓘ
_char7
only.Sourcepub const fn try_to_char8(self) -> Result<char8, DataOverflow> ⓘ
Available on crate feature _char8
only.
pub const fn try_to_char8(self) -> Result<char8, DataOverflow> ⓘ
_char8
only.Sourcepub const fn to_utf8_bytes(self) -> [u8; 3]
pub const fn to_utf8_bytes(self) -> [u8; 3]
Converts this char16
to an UTF-8 encoded sequence of bytes.
Note that this function always returns a 3-byte array, but the actual UTF-8 sequence may be shorter. The unused bytes are set to 0.
Sourcepub const fn to_ascii_uppercase(self) -> char16
pub const fn to_ascii_uppercase(self) -> char16
Makes a copy of the value in its ASCII upper case equivalent.
ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’, but non-ASCII letters are unchanged.
Sourcepub const fn to_ascii_lowercase(self) -> char16
pub const fn to_ascii_lowercase(self) -> char16
Makes a copy of the value in its ASCII lower case equivalent.
ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’, but non-ASCII letters are unchanged.
Sourcepub const fn is_noncharacter(self) -> bool
pub const fn is_noncharacter(self) -> bool
Returns true
if this unicode scalar is a noncharacter.
Sourcepub const fn is_character(self) -> bool
pub const fn is_character(self) -> bool
Returns true
if this unicode scalar is an abstract character.
Trait Implementations§
Source§impl BitSized<16> for char16
impl BitSized<16> for char16
Source§const BIT_SIZE: usize = _
const BIT_SIZE: usize = _
Source§const MIN_BYTE_SIZE: usize = _
const MIN_BYTE_SIZE: usize = _
Source§impl ConstDefault for char16
impl ConstDefault for char16
Source§impl Ord for char16
impl Ord for char16
Source§impl PartialOrd for char16
impl PartialOrd for char16
Source§impl UnicodeScalar for char16
impl UnicodeScalar for char16
Source§fn byte_len(self) -> usize ⓘ
fn byte_len(self) -> usize ⓘ
Source§fn encode_utf8(self, dst: &mut [u8]) -> &mut str ⓘ
fn encode_utf8(self, dst: &mut [u8]) -> &mut str ⓘ
Source§fn to_utf8_bytes(self) -> [u8; 4]
fn to_utf8_bytes(self) -> [u8; 4]
scalar
to an UTF-8 encoded sequence of bytes. Read moreSource§fn encode_utf16(self, dst: &mut [u16]) -> &mut [u16] ⓘ
fn encode_utf16(self, dst: &mut [u16]) -> &mut [u16] ⓘ
Source§fn to_digit(self, radix: u32) -> Option<u32> ⓘ
fn to_digit(self, radix: u32) -> Option<u32> ⓘ
Source§fn to_ascii_uppercase(self) -> Self
fn to_ascii_uppercase(self) -> Self
Source§fn to_ascii_lowercase(self) -> Self
fn to_ascii_lowercase(self) -> Self
Source§fn is_noncharacter(self) -> bool
fn is_noncharacter(self) -> bool
true
if this unicode scalar is a noncharacter.Source§fn is_digit(self, radix: u32) -> bool
fn is_digit(self, radix: u32) -> bool
Source§fn is_control(self) -> bool
fn is_control(self) -> bool
true
if this unicode scalar has the general category for
control codes.Source§fn is_alphabetic(self) -> bool
fn is_alphabetic(self) -> bool
true
if this unicode scalar has the Alphabetic
property.Source§fn is_numeric(self) -> bool
fn is_numeric(self) -> bool
true
if this unicode scalar has one of the general categories
for numbers. Read moreSource§fn is_alphanumeric(self) -> bool
fn is_alphanumeric(self) -> bool
Source§fn is_lowercase(self) -> bool
fn is_lowercase(self) -> bool
true
if this unicode scalar has the Lowercase
property.Source§fn is_uppercase(self) -> bool
fn is_uppercase(self) -> bool
true
if this unicode scalar has the Lowercase
property.Source§fn is_whitespace(self) -> bool
fn is_whitespace(self) -> bool
true
if this unicode scalar has the White_Space
property.Source§fn is_character(self) -> boolwhere
Self: Sized,
fn is_character(self) -> boolwhere
Self: Sized,
true
if this unicode scalar is an abstract character.impl Copy for char16
impl Eq for char16
impl StructuralPartialEq for char16
Auto Trait Implementations§
impl Freeze for char16
impl RefUnwindSafe for char16
impl Send for char16
impl Sync for char16
impl Unpin for char16
impl UnwindSafe for char16
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> ByteSized for T
impl<T> ByteSized for T
Source§const BYTE_ALIGN: usize = _
const BYTE_ALIGN: usize = _
Source§fn byte_align(&self) -> usize ⓘ
fn byte_align(&self) -> usize ⓘ
Source§fn ptr_size_ratio(&self) -> [usize; 2]
fn ptr_size_ratio(&self) -> [usize; 2]
Source§impl<T, R> Chain<R> for Twhere
T: ?Sized,
impl<T, R> Chain<R> for Twhere
T: ?Sized,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T> ExtAny for T
impl<T> ExtAny for T
Source§fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
fn as_any_mut(&mut self) -> &mut dyn Anywhere
Self: Sized,
Source§impl<T> ExtMem for Twhere
T: ?Sized,
impl<T> ExtMem for Twhere
T: ?Sized,
Source§const NEEDS_DROP: bool = _
const NEEDS_DROP: bool = _
Source§fn mem_align_of_val(&self) -> usize ⓘ
fn mem_align_of_val(&self) -> usize ⓘ
Source§fn mem_size_of_val(&self) -> usize ⓘ
fn mem_size_of_val(&self) -> usize ⓘ
Source§fn mem_needs_drop(&self) -> bool
fn mem_needs_drop(&self) -> bool
true
if dropping values of this type matters. Read moreSource§fn mem_forget(self)where
Self: Sized,
fn mem_forget(self)where
Self: Sized,
self
without running its destructor. Read moreSource§fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
fn mem_replace(&mut self, other: Self) -> Selfwhere
Self: Sized,
Source§unsafe fn mem_zeroed<T>() -> T
unsafe fn mem_zeroed<T>() -> T
unsafe_layout
only.T
represented by the all-zero byte-pattern. Read moreSource§unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe fn mem_transmute_copy<Src, Dst>(src: &Src) -> Dst
unsafe_layout
only.T
represented by the all-zero byte-pattern. Read moreSource§fn mem_as_bytes(&self) -> &[u8] ⓘ
fn mem_as_bytes(&self) -> &[u8] ⓘ
unsafe_slice
only.§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Hook for T
impl<T> Hook for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError> ⓘ
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError> ⓘ
§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out
indicating that a T
is niched.