Trait windows::Interface [−][src]
pub unsafe trait Interface: Sized + Abi { type Vtable; const IID: Guid; unsafe fn vtable(&self) -> &Self::Vtable { ... } unsafe fn assume_vtable<T: Interface>(&self) -> &T::Vtable { ... } unsafe fn query(&self, iid: *const Guid, interface: *mut RawPtr) -> HRESULT { ... } 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 used by the generated bindings and should not be used directly.
Associated Types
Associated Constants
Provided methods
unsafe fn assume_vtable<T: Interface>(&self) -> &T::Vtable
unsafe fn assume_vtable<T: Interface>(&self) -> &T::Vtable
Returns the vtable for an assumed interface. The name comes from Box::assume_init()
as
it assumes the vtable is implemented by the current interface’s vtable (e.g. a parent interface).
Attempts to cast the current interface to another interface using QueryInterface
.
The name cast
is preferred to query
because there is a WinRT method named query but not one
named cast.