Trait Interface

Source
pub unsafe trait Interface: Unknown {
    type Vtbl;

    const IID: Guid;

    // Required method
    fn inherits(iid: &Guid) -> bool;
}
Expand description

Implemented by all COM interface types.

§Safety

If a type I implements Interface, it must have the same layout as the pointer type *const I::Vtbl.

If I::inherits(J::IID) returns true, then the layout of J::Vtbl must be a prefix of the layout of I::Vtbl, i.e. a valid pointer to an instance of I::Vtbl must also be valid pointer to an instance of J::Vtbl.

Required Associated Constants§

Source

const IID: Guid

A 16-byte unique identifier (Guid) for the COM interface represented by this type.

Required Associated Types§

Source

type Vtbl

The type of the virtual method table for this interface.

Required Methods§

Source

fn inherits(iid: &Guid) -> bool

Returns true if this interface transitively inherits from the interface identified by iid.

Note that this has safety implications; see the top-level documentation for Interface.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§