Skip to main content

ComObjectInner

Trait ComObjectInner 

pub trait ComObjectInner: Sized {
    type Outer: IUnknownImpl<Impl = Self>;

    // Required method
    fn into_object(self) -> ComObject<Self>;
}
Expand description

Identifies types that can be placed in ComObject.

This is an implementation detail of the Windows crates. The #[implement] macro generates implementations so user code can use ComObject<T> instead of ComObject<T_Impl>.

Required Associated Types§

type Outer: IUnknownImpl<Impl = Self>

The generated <foo>_Impl type (aka the “boxed” or “outer” type).

Required Methods§

fn into_object(self) -> ComObject<Self>

Moves an instance of this type into a new ComObject box and returns it.

§Safety

Safe Rust code must not own a generated “outer” COM object type (e.g. <foo>_Impl), because it carries a reference count and methods that can destroy the object. The #[implement] macro constructs that value, places it on the heap, and returns only a ComObject reference.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§