[−][src]Struct safer_ffi::char_p::char_p_ref
A #[repr(c)]
null-terminated UTF-8 encoded string, for compatibility
with both the C char *
API and Rust's str
.
This is a borrowed version, i.e., with the semantics of
&'lt CStr
/ &'lt str
, but for it being a slim pointer.
C Layout
Implementations
impl char_p_ref<'static>
[src]
impl<'lt> char_p_ref<'lt>
[src]
pub const unsafe fn from_ptr_unchecked(ptr: NonNull<u8>) -> Self
[src]
impl<'lt> char_p_ref<'lt>
[src]
pub fn bytes(self: char_p_ref<'lt>) -> impl Iterator<Item = NonZeroU8> + 'lt
[src]
pub fn to_nonzero_bytes(self: char_p_ref<'lt>) -> &'lt [NonZeroU8]
[src]
pub fn to_bytes(self: char_p_ref<'lt>) -> &'lt [u8]
[src]
pub fn to_bytes_with_null(self: char_p_ref<'lt>) -> &'lt [u8]
[src]
pub fn to_str(self: char_p_ref<'lt>) -> &'lt str
[src]
pub fn to_str_with_null(self: char_p_ref<'lt>) -> &'lt str
[src]
pub fn to_owned(self: char_p_ref<'lt>) -> char_p_boxed
[src]
Trait Implementations
impl<'lt> Clone for char_p_ref<'lt>
[src]
fn clone(&self) -> char_p_ref<'lt>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'lt> Copy for char_p_ref<'lt>
[src]
impl<'_> Debug for char_p_ref<'_>
[src]
impl<'_> Display for char_p_ref<'_>
[src]
impl<'lt> Eq for char_p_ref<'lt>
[src]
impl<'lt> From<&'lt CStr> for char_p_ref<'lt>
[src]
Panic
Panics if the CStr
is not valid UTF-8.
fn from(s: &'lt CStr) -> char_p_ref<'lt>
[src]
impl<'lt> From<char_p_ref<'lt>> for char_p_raw
[src]
fn from(it: char_p_ref<'lt>) -> char_p_raw
[src]
impl<'lt> PartialEq<char_p_ref<'lt>> for char_p_ref<'lt>
[src]
impl<'lt> ReprC for char_p_ref<'lt> where
NonNullRef<c_char>: ReprC,
[src]
NonNullRef<c_char>: ReprC,
type CLayout = <NonNullRef<c_char> as ReprC>::CLayout
The CType
having the same layout as Self
.
fn is_valid(it: &Self::CLayout) -> bool
[src]
impl<'lt> TryFrom<&'lt str> for char_p_ref<'lt>
[src]
type Error = InvalidNulTerminator<()>
The type returned in the event of a conversion error.
fn try_from(s: &'lt str) -> Result<char_p_ref<'lt>, InvalidNulTerminator<()>>
[src]
Auto Trait Implementations
impl<'lt> RefUnwindSafe for char_p_ref<'lt>
impl<'lt> !Send for char_p_ref<'lt>
impl<'lt> !Sync for char_p_ref<'lt>
impl<'lt> Unpin for char_p_ref<'lt>
impl<'lt> UnwindSafe for char_p_ref<'lt>
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,
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.
fn to_owned(&self) -> T
[src]
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.
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>,