Trait binaryen::ToCStr [] [src]

pub trait ToCStr {
    type Storage;
    fn to_cstr_stash(self) -> Stash<Self::Storage>;
}

This trait provides a means for converting various types of strings into a pointer that can be passed into C code.

If you have a CString/&CStr you can use it to pass a C string pointer directly, without conversion. Otherwise, you can sacrifice your String to convert it into CString.

Associated Types

Required Methods

Make conversion to a C string (if needed) and then return a Stash — a pointer to the C string alongside with a storage which "owns" the data it points to.

Implementations on Foreign Types

impl<'a> ToCStr for &'a CStr
[src]

[src]

impl<'a> ToCStr for &'a str
[src]

[src]

impl ToCStr for String
[src]

[src]

Implementors