[][src]Trait com::AbiTransferable

pub unsafe trait AbiTransferable: Sized {
    type Abi;
    fn get_abi(&self) -> Self::Abi;
fn set_abi(&mut self) -> *mut Self::Abi; fn from_abi(abi: &Self::Abi) -> &Self { ... }
fn from_mut_abi(abi: &mut Self::Abi) -> &mut Self { ... }
unsafe fn slice_from_abi<'a>(
        abi: *const Self::Abi,
        len: usize
    ) -> &'a [Self] { ... }
unsafe fn slice_from_mut_abi<'a>(
        abi: *mut Self::Abi,
        len: usize
    ) -> &'a mut [Self] { ... }
fn into_abi(self) -> Self::Abi { ... } }

Types that are safe to transfer over a COM API boundary.

Safety

Implementing types only have associated Abi types that are safe to transfer over a COM FFI boundary. Implementing types must also be exactly equivalent to their associated types in layout and abi such that it is safe to transmute between the two types.

Associated Types

type Abi

The FFI compatible type the implementing type can turn into.

Loading content...

Required methods

fn get_abi(&self) -> Self::Abi

Turn the type into the FFI ABI type.

fn set_abi(&mut self) -> *mut Self::Abi

Set the abi of the implementing type

Loading content...

Provided methods

fn from_abi(abi: &Self::Abi) -> &Self

Convert into a reference to Self from a reference to the ABI

fn from_mut_abi(abi: &mut Self::Abi) -> &mut Self

The mut verison of from_abi

unsafe fn slice_from_abi<'a>(abi: *const Self::Abi, len: usize) -> &'a [Self]

Convert a pointer to a Self::Abi and and a length to a slice.

Safety

The abi pointer must be a valid pointer to an array of Self::Abi items of len size for the lifetime 'a. Nothing can mutate that array while the slice exists.

unsafe fn slice_from_mut_abi<'a>(
    abi: *mut Self::Abi,
    len: usize
) -> &'a mut [Self]

Convert a pointer to a Self::Abi and and a length to a mutable slice.

Safety

The same rules apply as with slice_from_abi but no other references into the slice are allowed while the slice exists.

fn into_abi(self) -> Self::Abi

Converts and consumes the ABI transferable type into its ABI representation.

Loading content...

Implementations on Foreign Types

impl AbiTransferable for bool[src]

type Abi = Self

impl AbiTransferable for i8[src]

type Abi = Self

impl AbiTransferable for u8[src]

type Abi = Self

impl AbiTransferable for i16[src]

type Abi = Self

impl AbiTransferable for u16[src]

type Abi = Self

impl AbiTransferable for i32[src]

type Abi = Self

impl AbiTransferable for u32[src]

type Abi = Self

impl AbiTransferable for i64[src]

type Abi = Self

impl AbiTransferable for u64[src]

type Abi = Self

impl AbiTransferable for f32[src]

type Abi = Self

impl AbiTransferable for f64[src]

type Abi = Self

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

type Abi = Self

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

type Abi = Self

impl<T: Interface> AbiTransferable for Option<T>[src]

type Abi = *mut NonNull<<T as Interface>::VTable>

Loading content...

Implementors

impl AbiTransferable for GUID[src]

type Abi = Self

impl<T: Interface> AbiTransferable for T[src]

type Abi = NonNull<NonNull<<T as Interface>::VTable>>

Loading content...