easy_imgui

Trait IntoCStr

Source
pub trait IntoCStr: Sized {
    type Temp: Deref<Target = CStr>;

    // Required methods
    fn into(self) -> Self::Temp;
    fn into_cstring(self) -> CString;
    fn len(&self) -> usize;

    // Provided methods
    fn is_empty(&self) -> bool { ... }
    unsafe fn push_to_non_null_vec(self, bs: &mut Vec<u8>) { ... }
}
Expand description

Represents any type that can be converted into something that can be deref’ed to a &CStr.

Required Associated Types§

Source

type Temp: Deref<Target = CStr>

Required Methods§

Source

fn into(self) -> Self::Temp

Source

fn into_cstring(self) -> CString

Source

fn len(&self) -> usize

Provided Methods§

Source

fn is_empty(&self) -> bool

Source

unsafe fn push_to_non_null_vec(self, bs: &mut Vec<u8>)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl IntoCStr for &str

Source§

type Temp = CString

Source§

fn into(self) -> Self::Temp

Source§

fn into_cstring(self) -> CString

Source§

fn len(&self) -> usize

Source§

unsafe fn push_to_non_null_vec(self, bs: &mut Vec<u8>)

Source§

impl IntoCStr for &String

Source§

type Temp = CString

Source§

fn into(self) -> Self::Temp

Source§

fn into_cstring(self) -> CString

Source§

fn len(&self) -> usize

Source§

unsafe fn push_to_non_null_vec(self, bs: &mut Vec<u8>)

Source§

impl IntoCStr for &CStr

Source§

type Temp = &CStr

Source§

fn into(self) -> Self

Source§

fn into_cstring(self) -> CString

Source§

fn len(&self) -> usize

Source§

impl IntoCStr for CString

Source§

type Temp = CString

Source§

fn into(self) -> Self

Source§

fn into_cstring(self) -> CString

Source§

fn len(&self) -> usize

Source§

impl IntoCStr for String

Source§

type Temp = CString

Source§

fn into(self) -> Self::Temp

Source§

fn into_cstring(self) -> CString

Source§

fn len(&self) -> usize

Source§

impl<'a> IntoCStr for &'a CString

Source§

type Temp = &'a CStr

Source§

fn into(self) -> &'a CStr

Source§

fn into_cstring(self) -> CString

Source§

fn len(&self) -> usize

Source§

impl<'a, B> IntoCStr for Cow<'a, B>
where B: 'a + ToOwned + ?Sized, &'a B: IntoCStr, B::Owned: IntoCStr, <&'a B as IntoCStr>::Temp: Into<Cow<'a, CStr>>,

Source§

type Temp = Cow<'a, CStr>

Source§

fn into(self) -> Cow<'a, CStr>

Source§

fn into_cstring(self) -> CString

Source§

fn len(&self) -> usize

Implementors§