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 { ... }
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

Loading content...

Associated Constants

const IID: Guid[src]

Loading content...

Provided methods

unsafe fn vtable(&self) -> &Self::Vtable[src]

Expand description

Returns the vtable for the current interface.

unsafe fn assume_vtable<T: Interface>(&self) -> &T::Vtable[src]

Expand description

Returns the vtable for an assumed interface. The name comes from Box’s assume_init method as it assumes the vtable is implemented by the current interface’s vtable (e.g. a parent interface).

fn cast<T: Interface>(&self) -> Result<T>[src]

Expand description

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.

fn downgrade(&self) -> Result<Weak<Self>>[src]

Expand description

Attempts to create a Weak reference to this object.

Loading content...

Implementors

impl Interface for IInspectable[src]

type Vtable = IInspectable_abi

const IID: Guid[src]

impl Interface for IUnknown[src]

type Vtable = IUnknown_abi

const IID: Guid[src]

Loading content...