[][src]Trait com::Interface

pub unsafe trait Interface: Sized + 'static {
    type VTable;
    type Super: Interface;

    const IID: IID;
    fn is_iid_in_inheritance_chain(riid: &IID) -> bool { ... }
fn as_iunknown(&self) -> &IUnknown { ... }
fn as_raw(&self) -> NonNull<NonNull<Self::VTable>> { ... } }

A COM compliant interface pointer

Safety

The struct implementing this trait must provide a valid vtable as the associated VTable type. A vtable is valid if:

  • it is #[repr(C)]
  • the type only contains `extern "stdcall" fn" definitions

The implementor must be a transparrently equivalent to a valid interface pointer for the interface T. An interface pointer as the name suggests points to an interface. A valid interface is itself trivial castable to a *mut T::VTable. In other words, the implementing type must also be equal to *mut *const T::VTable

Associated Types

type VTable

A COM compatible V-Table

type Super: Interface

The interface that this interface inherits from

Loading content...

Associated Constants

const IID: IID

The associated id for this interface

Loading content...

Provided methods

fn is_iid_in_inheritance_chain(riid: &IID) -> bool

Check whether a given IID is in the inheritance hierarchy of this interface

fn as_iunknown(&self) -> &IUnknown

Cast the interface pointer to a pointer to IUnknown.

fn as_raw(&self) -> NonNull<NonNull<Self::VTable>>

Cast the COM interface pointer to a raw pointer

The returned pointer is only guranteed valid for as long as the reference to self id valid.

Loading content...

Implementors

impl Interface for IClassFactory[src]

impl Interface for IUnknown[src]

Loading content...