pub enum Utf32String {
Ascii(Box<str>),
Unicode(Box<[char]>),
}
Expand description
An owned version of Utf32Str
.
Variants§
Ascii(Box<str>)
A string represented as ASCII encoded bytes. Correctness invariant: must only contain valid ASCII (<=127)
Unicode(Box<[char]>)
A string represented as an array of unicode codepoints (basically UTF-32).
Implementations§
Source§impl Utf32String
impl Utf32String
Sourcepub fn slice(&self, range: impl RangeBounds<usize>) -> Utf32Str<'_>
pub fn slice(&self, range: impl RangeBounds<usize>) -> Utf32Str<'_>
Creates a slice with a string that contains the characters in the specified character range.
Sourcepub fn slice_u32(&self, range: impl RangeBounds<u32>) -> Utf32Str<'_>
pub fn slice_u32(&self, range: impl RangeBounds<u32>) -> Utf32Str<'_>
Same as slice
but accepts a u32 range for convenience since
those are the indices returned by the matcher.
Trait Implementations§
Source§impl Clone for Utf32String
impl Clone for Utf32String
Source§fn clone(&self) -> Utf32String
fn clone(&self) -> Utf32String
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Utf32String
impl Debug for Utf32String
Source§impl Default for Utf32String
impl Default for Utf32String
Source§impl Display for Utf32String
impl Display for Utf32String
Source§impl From<&str> for Utf32String
impl From<&str> for Utf32String
Source§impl From<String> for Utf32String
impl From<String> for Utf32String
Source§impl Hash for Utf32String
impl Hash for Utf32String
Source§impl Ord for Utf32String
impl Ord for Utf32String
Source§fn cmp(&self, other: &Utf32String) -> Ordering
fn cmp(&self, other: &Utf32String) -> Ordering
1.21.0 · 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
Source§impl PartialEq for Utf32String
impl PartialEq for Utf32String
Source§impl PartialOrd for Utf32String
impl PartialOrd for Utf32String
impl Eq for Utf32String
impl StructuralPartialEq for Utf32String
Auto Trait Implementations§
impl Freeze for Utf32String
impl RefUnwindSafe for Utf32String
impl Send for Utf32String
impl Sync for Utf32String
impl Unpin for Utf32String
impl UnwindSafe for Utf32String
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