pub enum StringRepr {
OneByte(Box<[u8]>),
TwoByte(Box<[u16]>),
}Variants§
Implementations§
Source§impl StringRepr
impl StringRepr
pub fn from_text(text: &str) -> StringRepr
pub fn from_units(units: &[u16]) -> StringRepr
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn unit(&self, index: usize) -> u16
pub fn units(&self) -> impl Iterator<Item = u16> + '_
pub fn content_bytes(&self) -> usize
Sourcepub fn to_rust_string(&self) -> String
pub fn to_rust_string(&self) -> String
Lossy conversion for diagnostics and tests.
Sourcepub fn array_index(&self) -> Option<u32>
pub fn array_index(&self) -> Option<u32>
The canonical array index (0 ..= 2^32 - 2) this string spells, if any.
pub fn content_hash(&self) -> u32
Trait Implementations§
Source§impl Clone for StringRepr
impl Clone for StringRepr
Source§impl Debug for StringRepr
impl Debug for StringRepr
impl Eq for StringRepr
Source§impl PartialEq for StringRepr
impl PartialEq for StringRepr
impl StructuralPartialEq for StringRepr
Auto Trait Implementations§
impl Freeze for StringRepr
impl RefUnwindSafe for StringRepr
impl Send for StringRepr
impl Sync for StringRepr
impl Unpin for StringRepr
impl UnsafeUnpin for StringRepr
impl UnwindSafe for StringRepr
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