Struct GraphemeNonul
pub struct GraphemeNonul<const CAP: usize>(/* private fields */);
Expand description
𝐓
An EGC backed by a StringNonul
.
Implementations§
§impl<const CAP: usize> GraphemeNonul<CAP>
impl<const CAP: usize> GraphemeNonul<CAP>
pub const fn new() -> Result<GraphemeNonul<CAP>, MismatchedCapacity> ⓘ
pub const fn new() -> Result<GraphemeNonul<CAP>, MismatchedCapacity> ⓘ
pub const fn from_char7(
c: char7,
) -> Result<GraphemeNonul<CAP>, MismatchedCapacity> ⓘ
pub const fn from_char7( c: char7, ) -> Result<GraphemeNonul<CAP>, MismatchedCapacity> ⓘ
Creates a new GraphemeNonul
from a char7
.
If c
.is_nul()
an empty grapheme will be returned.
§Errors
Returns MismatchedCapacity
if CAP
> 255,
or if !c.is_nul()
and CAP
< 1.
Will always succeed if CAP
>= 1.
pub const fn from_char8(
c: char8,
) -> Result<GraphemeNonul<CAP>, MismatchedCapacity> ⓘ
pub const fn from_char8( c: char8, ) -> Result<GraphemeNonul<CAP>, MismatchedCapacity> ⓘ
Creates a new GraphemeNonul
from a char8
.
If c
.is_nul()
an empty grapheme will be returned.
§Errors
Returns MismatchedCapacity
if CAP
> 255,
or if !c.is_nul()
and CAP
< c.
len_utf8()
.
Will always succeed if CAP
>= 2.
pub const fn from_char16(
c: char16,
) -> Result<GraphemeNonul<CAP>, MismatchedCapacity> ⓘ
pub const fn from_char16( c: char16, ) -> Result<GraphemeNonul<CAP>, MismatchedCapacity> ⓘ
Creates a new GraphemeNonul
from a char16
.
If c
.is_nul()
an empty grapheme will be returned.
§Errors
Returns MismatchedCapacity
if CAP
> 255,
or if !c.is_nul()
and CAP
< c.
len_utf8()
.
Will always succeed if CAP
>= 3.
pub const fn from_char(
c: char,
) -> Result<GraphemeNonul<CAP>, MismatchedCapacity> ⓘ
pub const fn from_char( c: char, ) -> Result<GraphemeNonul<CAP>, MismatchedCapacity> ⓘ
Creates a new GraphemeNonul
from a char
.
If c
.is_nul()
an empty grapheme will be returned.
§Errors
Returns MismatchedCapacity
if CAP
> 255,
or if !c.is_nul()
and CAP
< c.
len_utf8()
.
Will always succeed if CAP
>= 4.
pub const fn remaining_capacity(&self) -> usize ⓘ
pub const fn remaining_capacity(&self) -> usize ⓘ
Returns the remaining capacity.
pub const fn clear(&mut self)
pub const fn clear(&mut self)
Sets the length to 0, by resetting all bytes to 0.
pub const fn as_bytes_mut(&mut self) -> &mut [u8] ⓘ
pub const fn as_bytes_mut(&mut self) -> &mut [u8] ⓘ
Returns a mutable byte slice of the inner string slice.
pub const fn as_array(&self) -> [u8; CAP]
pub const fn as_array(&self) -> [u8; CAP]
Returns a copy of the inner array with the full contents.
The array contains all the bytes, including those outside the current length.
pub const fn into_array(self) -> [u8; CAP]
pub const fn into_array(self) -> [u8; CAP]
Returns the inner array with the full contents.
The array contains all the bytes, including those outside the current length.
pub const unsafe fn as_mut_str(&mut self) -> &mut str ⓘ
Available on crate feature unsafe_slice
only.
pub const unsafe fn as_mut_str(&mut self) -> &mut str ⓘ
unsafe_slice
only.Trait Implementations§
Source§impl<const LEN: usize> BitSized<LEN> for GraphemeNonul<LEN>
impl<const LEN: usize> BitSized<LEN> for GraphemeNonul<LEN>
Source§const BIT_SIZE: usize = _
const BIT_SIZE: usize = _
Source§const MIN_BYTE_SIZE: usize = _
const MIN_BYTE_SIZE: usize = _
§impl<const CAP: usize> Clone for GraphemeNonul<CAP>
impl<const CAP: usize> Clone for GraphemeNonul<CAP>
§fn clone(&self) -> GraphemeNonul<CAP>
fn clone(&self) -> GraphemeNonul<CAP>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<const CAP: usize> ConstDefault for GraphemeNonul<CAP>
impl<const CAP: usize> ConstDefault for GraphemeNonul<CAP>
§impl<const CAP: usize> Debug for GraphemeNonul<CAP>
impl<const CAP: usize> Debug for GraphemeNonul<CAP>
§impl<const CAP: usize> Default for GraphemeNonul<CAP>
impl<const CAP: usize> Default for GraphemeNonul<CAP>
§fn default() -> GraphemeNonul<CAP>
fn default() -> GraphemeNonul<CAP>
Returns an empty extended grapheme character.
§impl<const CAP: usize> Display for GraphemeNonul<CAP>
impl<const CAP: usize> Display for GraphemeNonul<CAP>
§impl<const CAP: usize> Hash for GraphemeNonul<CAP>
impl<const CAP: usize> Hash for GraphemeNonul<CAP>
§impl<const CAP: usize> Ord for GraphemeNonul<CAP>
impl<const CAP: usize> Ord for GraphemeNonul<CAP>
§fn cmp(&self, other: &GraphemeNonul<CAP>) -> Ordering
fn cmp(&self, other: &GraphemeNonul<CAP>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
§impl<const CAP: usize> PartialEq for GraphemeNonul<CAP>
impl<const CAP: usize> PartialEq for GraphemeNonul<CAP>
§impl<const CAP: usize> PartialOrd for GraphemeNonul<CAP>
impl<const CAP: usize> PartialOrd for GraphemeNonul<CAP>
impl<const CAP: usize> Eq for GraphemeNonul<CAP>
impl<const CAP: usize> Grapheme for GraphemeNonul<CAP>
impl<const CAP: usize> StructuralPartialEq for GraphemeNonul<CAP>
Auto Trait Implementations§
impl<const CAP: usize> Freeze for GraphemeNonul<CAP>
impl<const CAP: usize> RefUnwindSafe for GraphemeNonul<CAP>
impl<const CAP: usize> UnwindSafe for GraphemeNonul<CAP>
impl<const CAP: usize> Send for GraphemeNonul<CAP>
impl<const CAP: usize> Sync for GraphemeNonul<CAP>
impl<const CAP: usize> Unpin for GraphemeNonul<CAP>
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
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]
§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.§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
Source§impl<T> ExtAny for T
impl<T> ExtAny for T
Source§fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64 ⓘ
fn type_hash_with<H: Hasher>(&self, hasher: H) -> u64 ⓘ
TypeId
of Self
using a custom hasher.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
§impl<T> Hook for T
impl<T> Hook for T
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