#[repr(transparent)]pub struct CStrPtr<'a> { /* private fields */ }
Implementations§
source§impl<'a> CStrPtr<'a>
impl<'a> CStrPtr<'a>
pub const fn from_c_str(str: &'a CStr) -> Self
pub const unsafe fn from_ptr(ptr: *const c_char) -> Self
pub fn from_bytes_with_nul( bytes: &'a [u8] ) -> Result<Self, FromBytesWithNulError>
pub const unsafe fn from_bytes_with_nul_unchecked(bytes: &'a [u8]) -> Self
pub const fn as_ptr(self) -> *const c_char
pub fn to_bytes(self) -> &'a [u8] ⓘ
pub fn to_bytes_with_nul(self) -> &'a [u8] ⓘ
pub fn to_c_str(self) -> &'a CStr
pub fn to_str(self) -> Result<&'a str, Utf8Error>
pub fn to_string_lossy(self) -> Cow<'a, str>
Trait Implementations§
source§impl<'a> Ord for CStrPtr<'a>
impl<'a> Ord for CStrPtr<'a>
source§impl<'a> PartialEq<CStrPtr<'a>> for CStrPtr<'a>
impl<'a> PartialEq<CStrPtr<'a>> for CStrPtr<'a>
source§impl<'a> PartialOrd<CStrPtr<'a>> for CStrPtr<'a>
impl<'a> PartialOrd<CStrPtr<'a>> for CStrPtr<'a>
1.0.0 · source§fn 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