pub struct Str(/* private fields */);Expand description
Implementations§
Source§impl Str
impl Str
pub const fn as_bytes(&self) -> &Slice<u8>
pub const fn as_ptr(&self) -> *const u8
pub const fn len(&self) -> usize
Sourcepub unsafe fn try_as_str_mut_custom<'a>(
&self,
custom_validate: impl FnOnce(*const ()) -> bool,
) -> Result<&'a mut str, InvalidStrError>
pub unsafe fn try_as_str_mut_custom<'a>( &self, custom_validate: impl FnOnce(*const ()) -> bool, ) -> Result<&'a mut str, InvalidStrError>
Sourcepub unsafe fn try_as_str_custom<'a>(
&self,
custom_validate: impl FnOnce(*const ()) -> bool,
) -> Result<&'a str, InvalidStrError>
pub unsafe fn try_as_str_custom<'a>( &self, custom_validate: impl FnOnce(*const ()) -> bool, ) -> Result<&'a str, InvalidStrError>
Sourcepub unsafe fn try_as_str<'a>(&self) -> Result<&'a str, InvalidStrError>
pub unsafe fn try_as_str<'a>(&self) -> Result<&'a str, InvalidStrError>
Sourcepub unsafe fn try_as_str_mut<'a>(&self) -> Result<&'a mut str, InvalidStrError>
pub unsafe fn try_as_str_mut<'a>(&self) -> Result<&'a mut str, InvalidStrError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Str
impl RefUnwindSafe for Str
impl !Send for Str
impl !Sync for Str
impl Unpin for Str
impl UnwindSafe for Str
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