Trait com::Interface [−][src]
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>> { ... }
}
Expand description
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 “system” 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
Associated Constants
Provided methods
fn is_iid_in_inheritance_chain(riid: &IID) -> bool
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
fn as_iunknown(&self) -> &IUnknown
Cast the interface pointer to a pointer to IUnknown.