[−][src]Struct memur::UStr
UTF-8 string that does not contain nul values, and is stored with nul termination for easy conversion to CStr.
This string is valid even when Arena
is dropped, because it holds a weak arena reference
which does not return memory back to Memory
as long as it is alive. That said, make sure to
drop all these strings to reclaim the memory.
Implementations
impl UStr
[src]
pub fn from_cstr(arena: &Arena, value: &CStr) -> Result<UStr, UStrError>
[src]
Initialize from &CStr.
pub fn from_trusted_cstr_ptr(
arena: &Arena,
bytes: *const i8
) -> Result<UStr, UStrError>
[src]
arena: &Arena,
bytes: *const i8
) -> Result<UStr, UStrError>
Initialize from char*
which comes from a trusted source.
pub fn from_str(arena: &Arena, value: &str) -> Result<UStr, UStrError>
[src]
Initialize from &str.
pub fn as_ptr(&self) -> *const i8
[src]
Get pointer to char*
.
Trait Implementations
impl AsRef<CStr> for UStr
[src]
impl AsRef<str> for UStr
[src]
impl Clone for UStr
[src]
impl Debug for UStr
[src]
impl Display for UStr
[src]
impl Eq for UStr
[src]
impl PartialEq<UStr> for UStr
[src]
impl PartialEq<UStr> for str
[src]
impl PartialEq<UStr> for String
[src]
impl PartialEq<UStr> for CStr
[src]
impl PartialEq<UStr> for CString
[src]
impl PartialEq<str> for UStr
[src]
Auto Trait Implementations
impl RefUnwindSafe for UStr
impl !Send for UStr
impl !Sync for UStr
impl Unpin for UStr
impl UnwindSafe for UStr
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,