[−][src]Struct safer_ffi::char_p::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]
This is supported on
feature="alloc"
only.pub fn as_ref(self: &char_p_boxed) -> char_p_ref
[src]
This is supported on
feature="alloc"
only.impl char_p_boxed
[src]
pub fn bytes<'lt>(
self: &'lt char_p_boxed
) -> impl Iterator<Item = NonZeroU8> + 'lt
[src]
self: &'lt char_p_boxed
) -> impl Iterator<Item = NonZeroU8> + 'lt
This is supported on
feature="alloc"
only.pub fn to_nonzero_bytes(self: &char_p_boxed) -> &[NonZeroU8]
[src]
This is supported on
feature="alloc"
only.pub fn to_bytes(self: &char_p_boxed) -> &[u8]
[src]
This is supported on
feature="alloc"
only.pub fn to_bytes_with_null(self: &char_p_boxed) -> &[u8]
[src]
This is supported on
feature="alloc"
only.pub fn to_str(self: &char_p_boxed) -> &str
[src]
This is supported on
feature="alloc"
only.pub fn to_str_with_null(self: &char_p_boxed) -> &str
[src]
This is supported on
feature="alloc"
only.pub fn into_vec(self: char_p_boxed) -> Vec<u8>
[src]
This is supported on
feature="alloc"
only.pub fn into_string(self: char_p_boxed) -> String
[src]
This is supported on
feature="alloc"
only.pub fn to_owned(self: &char_p_boxed) -> char_p_boxed
[src]
This is supported on
feature="alloc"
only.Trait Implementations
impl Clone for char_p_boxed
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for char_p_boxed
[src]
impl Display for char_p_boxed
[src]
impl Drop for char_p_boxed
[src]
fn drop(self: &mut 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.
fn from(s: CString) -> char_p_boxed
[src]
impl PartialEq<char_p_boxed> for char_p_boxed
[src]
impl ReprC for char_p_boxed where
NonNullOwned<c_char>: ReprC,
[src]
NonNullOwned<c_char>: ReprC,
type CLayout = <NonNullOwned<c_char> as ReprC>::CLayout
The CType
having the same layout as Self
.
fn is_valid(it: &Self::CLayout) -> bool
[src]
impl Send for char_p_boxed where
Box<[u8]>: Send,
[src]
Box<[u8]>: Send,
impl Sync for char_p_boxed where
Box<[u8]>: Sync,
[src]
Box<[u8]>: Sync,
impl TryFrom<String> for char_p_boxed
[src]
type Error = InvalidNulTerminator<String>
The type returned in the event of a conversion error.
fn try_from(s: String) -> Result<char_p_boxed, InvalidNulTerminator<String>>
[src]
Auto Trait Implementations
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> ManuallyDropMut for T
type Ret = ManuallyDrop<T>
fn manually_drop_mut(&'__ mut self) -> &'__ mut ManuallyDrop<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>,