pub unsafe trait Interface: Vtable {
const IID: GUID;
fn cast<T: Interface>(&self) -> Result<T> { ... }
fn downgrade(&self) -> Result<Weak<Self>> { ... }
}
Expand description
Provides low-level access to a COM interface.
This trait is automatically implemented by the generated bindings and should not be implemented manually.
Safety
It is only safe to implement this trait if the implementing type is a valid COM interface pointer meaning the following criteria are met:
- its in-memory representation is equal to
NonNull<NonNull<Self::VTable>>
- the vtable is correctly structured beginning with the
IUnknown
function pointers - the vtable must be the correct vtable for the supplied IID