Trait e_utils::parse::CAutoParse

source ·
pub unsafe trait CAutoParse {
    // Required methods
    unsafe fn c_to_cstring(&self) -> CString;
    unsafe fn c_to_string(&self) -> String;
    fn c_to_ptr(self) -> *const c_void;
    fn c_to_mut_ptr(self) -> *mut c_void;
    unsafe fn c_to_any<T>(self) -> Option<Box<T>>;
}
Expand description

针对C/C++

Required Methods§

source

unsafe fn c_to_cstring(&self) -> CString

C转CsString

source

unsafe fn c_to_string(&self) -> String

C转String

source

fn c_to_ptr(self) -> *const c_void

安全地获取<Box>实例的*c_void指针

source

fn c_to_mut_ptr(self) -> *mut c_void

安全地获取<Box>实例的*mut c_void指针

source

unsafe fn c_to_any<T>(self) -> Option<Box<T>>

安全地还原*c_void指针为<Box>实例

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl CAutoParse for *const c_void

source§

unsafe fn c_to_cstring(&self) -> CString

source§

unsafe fn c_to_string(&self) -> String

source§

fn c_to_ptr(self) -> *const c_void

source§

fn c_to_mut_ptr(self) -> *mut c_void

source§

unsafe fn c_to_any<T>(self) -> Option<Box<T>>

source§

impl CAutoParse for *const c_char

source§

unsafe fn c_to_cstring(&self) -> CString

source§

unsafe fn c_to_string(&self) -> String

source§

unsafe fn c_to_any<T: Sized>(self) -> Option<Box<T>>

source§

fn c_to_ptr(self) -> *const c_void

source§

fn c_to_mut_ptr(self) -> *mut c_void

source§

impl CAutoParse for *mut c_void

source§

unsafe fn c_to_cstring(&self) -> CString

source§

unsafe fn c_to_string(&self) -> String

source§

fn c_to_ptr(self) -> *const c_void

source§

fn c_to_mut_ptr(self) -> *mut c_void

source§

unsafe fn c_to_any<T>(self) -> Option<Box<T>>

source§

impl CAutoParse for *mut c_char

source§

unsafe fn c_to_cstring(&self) -> CString

source§

unsafe fn c_to_string(&self) -> String

source§

fn c_to_ptr(self) -> *const c_void

source§

fn c_to_mut_ptr(self) -> *mut c_void

source§

unsafe fn c_to_any<T: Sized>(self) -> Option<Box<T>>

Implementors§