Skip to main content

IntoCString

Trait IntoCString 

Source
pub trait IntoCString {
    // Required method
    fn into_c_string(self) -> Result<CString, Error>;
}
Expand description

A class of types that can be converted to C strings.

These types are represented internally as byte slices and it is quite rare for them to contain an interior 0 byte.

Required Methods§

Source

fn into_c_string(self) -> Result<CString, Error>

Consume this container, converting it into a CString

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl IntoCString for CString

Source§

impl IntoCString for OsString

Source§

impl IntoCString for PathBuf

Source§

impl IntoCString for String

Source§

impl IntoCString for Vec<u8>

Source§

impl<'a, T: IntoCString + Clone> IntoCString for &'a T

Source§

impl<'a> IntoCString for &'a OsStr

Source§

impl<'a> IntoCString for &'a Path

Source§

impl<'a> IntoCString for &'a [u8]

Source§

impl<'a> IntoCString for &'a str

Implementors§