#[repr(transparent)]pub struct MStr { /* private fields */ }
Expand description
A Modified UTF-8 string slice, like str.
Implementations
sourceimpl MStr
impl MStr
sourcepub fn from_bytes(v: &[u8]) -> Result<&MStr, DecodeError>
pub fn from_bytes(v: &[u8]) -> Result<&MStr, DecodeError>
Creates a new string from a modified UTF-8 byte slice.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn as_bytes(&self) -> &[u8]ⓘNotable traits for &'_ mut [u8]impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
pub fn to_str(&self) -> Option<&str>
pub fn is_char_boundary(&self, index: usize) -> bool
pub fn chars(&self) -> Chars<'_>ⓘNotable traits for Chars<'a>impl<'a> Iterator for Chars<'a> type Item = Option<char>;
pub fn chars_lossy(&self) -> CharsLossy<'_>ⓘNotable traits for CharsLossy<'a>impl<'a> Iterator for CharsLossy<'a> type Item = char;
pub fn display(&self) -> Display<'_>
Trait Implementations
sourceimpl Index<RangeInclusive<usize>> for MStr
impl Index<RangeInclusive<usize>> for MStr
sourceimpl Index<RangeToInclusive<usize>> for MStr
impl Index<RangeToInclusive<usize>> for MStr
sourceimpl Ord for MStr
impl Ord for MStr
sourceimpl PartialOrd<MStr> for MStr
impl PartialOrd<MStr> for MStr
sourcefn partial_cmp(&self, other: &MStr) -> Option<Ordering>
fn partial_cmp(&self, other: &MStr) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl ToOwned for MStr
impl ToOwned for MStr
impl Eq for MStr
impl StructuralEq for MStr
impl StructuralPartialEq for MStr
Auto Trait Implementations
impl RefUnwindSafe for MStr
impl Send for MStr
impl !Sized for MStr
impl Sync for MStr
impl Unpin for MStr
impl UnwindSafe for MStr
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.