Trait makepad_widgets::shader::std::windows::core::ComInterface
pub unsafe trait ComInterface: Interface + Clone {
const IID: GUID;
// Provided methods
fn as_unknown(&self) -> &IUnknown { ... }
fn cast<T>(&self) -> Result<T, Error>
where T: ComInterface { ... }
fn downgrade(&self) -> Result<Weak<Self>, Error> { ... }
}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
IUnknownfunction pointers - the vtable must be the correct vtable for the supplied IID
Required Associated Constants§
Provided Methods§
fn as_unknown(&self) -> &IUnknown
fn cast<T>(&self) -> Result<T, Error>where
T: ComInterface,
fn cast<T>(&self) -> Result<T, Error>where T: ComInterface,
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.