[][src]Struct safer_ffi::char_p::char_p_boxed

#[repr(transparent)]pub struct char_p_boxed(_);

A #[repr(c)] null-terminated UTF-8 encoded string, for compatibility with both the char * C API and Rust str.

This is an owned / heap-allocated version, much like Box<str> / Box<CStr> but for it being a slim pointer.

C Layout

Implementations

impl char_p_boxed[src]

pub const unsafe fn from_ptr_unchecked(ptr: NonNull<u8>) -> char_p_boxed[src]

pub fn as_ref(self: &char_p_boxed) -> char_p_ref[src]

impl char_p_boxed[src]

pub fn bytes<'lt>(
    self: &'lt char_p_boxed
) -> impl Iterator<Item = NonZeroU8> + 'lt
[src]

pub fn to_nonzero_bytes(self: &char_p_boxed) -> &[NonZeroU8][src]

pub fn to_bytes(self: &char_p_boxed) -> &[u8][src]

pub fn to_bytes_with_null(self: &char_p_boxed) -> &[u8][src]

pub fn to_str(self: &char_p_boxed) -> &str[src]

pub fn to_str_with_null(self: &char_p_boxed) -> &str[src]

pub fn into_vec(self: char_p_boxed) -> Vec<u8>[src]

pub fn into_string(self: char_p_boxed) -> String[src]

pub fn to_owned(self: &char_p_boxed) -> char_p_boxed[src]

Trait Implementations

impl Clone for char_p_boxed[src]

impl Debug for char_p_boxed[src]

impl Display for char_p_boxed[src]

impl Drop for char_p_boxed[src]

impl Eq for char_p_boxed[src]

impl From<CString> for char_p_boxed[src]

Panic

Panics if the CString is not valid UTF-8.

impl PartialEq<char_p_boxed> for char_p_boxed[src]

impl ReprC for char_p_boxed where
    NonNullOwned<c_char>: ReprC
[src]

type CLayout = <NonNullOwned<c_char> as ReprC>::CLayout

The CType having the same layout as Self.

impl Send for char_p_boxed where
    Box<[u8]>: Send
[src]

impl Sync for char_p_boxed where
    Box<[u8]>: Sync
[src]

impl TryFrom<String> for char_p_boxed[src]

type Error = InvalidNulTerminator<String>

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.