pub struct StrData { /* private fields */ }Implementations§
Source§impl StrData
impl StrData
Sourcepub unsafe fn new_str_unchecked(data: Box<Wtf8>, kind: StrKind) -> Self
pub unsafe fn new_str_unchecked(data: Box<Wtf8>, kind: StrKind) -> Self
§Safety
Given bytes must be valid data for given kind
Sourcepub unsafe fn new_with_char_len(
data: Box<Wtf8>,
kind: StrKind,
char_len: usize,
) -> Self
pub unsafe fn new_with_char_len( data: Box<Wtf8>, kind: StrKind, char_len: usize, ) -> Self
§Safety
char_len must be accurate.
pub const fn as_wtf8(&self) -> &Wtf8
pub fn as_str(&self) -> Option<&str>
pub fn as_ascii(&self) -> Option<&AsciiStr>
pub const fn kind(&self) -> StrKind
pub fn as_str_kind(&self) -> PyKindStr<'_>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn char_len(&self) -> usize
pub fn nth_char(&self, index: usize) -> CodePoint
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for StrData
impl !RefUnwindSafe for StrData
impl Send for StrData
impl !Sync for StrData
impl Unpin for StrData
impl UnsafeUnpin for StrData
impl UnwindSafe for StrData
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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