Trait FFIConversionTo

Source
pub trait FFIConversionTo<T> {
    // Required method
    unsafe fn ffi_to_const(obj: T) -> *const Self;

    // Provided methods
    unsafe fn ffi_to(obj: T) -> *mut Self { ... }
    unsafe fn ffi_to_opt(obj: Option<T>) -> *mut Self
       where Self: Sized { ... }
}

Required Methods§

Source

unsafe fn ffi_to_const(obj: T) -> *const Self

§Safety

Provided Methods§

Source

unsafe fn ffi_to(obj: T) -> *mut Self

§Safety
Source

unsafe fn ffi_to_opt(obj: Option<T>) -> *mut Self
where Self: Sized,

§Safety

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 FFIConversionTo<&str> for c_char

Source§

unsafe fn ffi_to_const(obj: &str) -> *const Self

Source§

unsafe fn ffi_to(obj: &str) -> *mut Self

Source§

impl FFIConversionTo<i128> for [u8; 16]

Source§

unsafe fn ffi_to_const(obj: i128) -> *const Self

Source§

impl FFIConversionTo<u128> for [u8; 16]

Source§

unsafe fn ffi_to_const(obj: u128) -> *const Self

Source§

impl FFIConversionTo<String> for c_char

Source§

unsafe fn ffi_to_const(obj: String) -> *const Self

Source§

unsafe fn ffi_to(obj: String) -> *mut Self

Implementors§

Source§

impl FFIConversionTo<&[u8]> for ByteArray

Source§

impl<T, FFI> FFIConversionTo<Box<T>> for FFI
where FFI: FFIConversionTo<T>,