[][src]Trait ffi_utils::ReprC

pub trait ReprC {
    type C;
    type Error;
    unsafe fn clone_from_repr_c(repr_c: Self::C) -> Result<Self, Self::Error>
    where
        Self: Sized
; }

Trait to convert between FFI and Rust representations of types.

Associated Types

type C

C representation of the type.

type Error

Error type.

Loading content...

Required methods

unsafe fn clone_from_repr_c(repr_c: Self::C) -> Result<Self, Self::Error> where
    Self: Sized

Convert from a raw FFI type into a native Rust type by cloning the data.

Safety

The implementation of this function may be unsafe, as repr_c may be a raw pointer that needs to be valid.

Loading content...

Implementations on Foreign Types

impl ReprC for String[src]

type C = *const c_char

type Error = StringError

impl ReprC for i32[src]

type C = i32

type Error = ()

impl ReprC for i64[src]

type C = i64

type Error = ()

impl ReprC for u32[src]

type C = u32

type Error = ()

impl ReprC for u64[src]

type C = u64

type Error = ()

impl ReprC for usize[src]

type C = usize

type Error = ()

impl<T> ReprC for *const T[src]

type C = *const T

type Error = ()

impl<T> ReprC for *mut T[src]

type C = *mut T

type Error = ()

impl ReprC for [u8; 24][src]

type C = *const [u8; 24]

type Error = ()

impl ReprC for [u8; 32][src]

type C = *const [u8; 32]

type Error = ()

impl ReprC for [u8; 48][src]

type C = *const [u8; 48]

type Error = ()

impl ReprC for [u8; 64][src]

type C = *const [u8; 64]

type Error = ()

impl ReprC for [u8; 96][src]

type C = *const [u8; 96]

type Error = ()

impl ReprC for bool[src]

type C = u32

type Error = ()

Loading content...

Implementors

impl ReprC for NativeResult[src]

type C = *const FfiResult

type Error = StringError

Loading content...