Trait ComWrapper

Source
pub trait ComWrapper {
    type Interface: Interface;

    // Required methods
    unsafe fn get_raw(&self) -> *mut Self::Interface;
    unsafe fn into_raw(self) -> *mut Self::Interface;
    unsafe fn from_raw(raw: *mut Self::Interface) -> Self;
    unsafe fn from_ptr(ptr: ComPtr<Self::Interface>) -> Self;
    unsafe fn into_ptr(self) -> ComPtr<Self::Interface>;
}

Required Associated Types§

Source

type Interface: Interface

The raw interface type from winapi

Required Methods§

Source

unsafe fn get_raw(&self) -> *mut Self::Interface

Gets a raw pointer to the interface. Does not increment the reference count

Source

unsafe fn into_raw(self) -> *mut Self::Interface

Consumes the wrapper without affecting the reference count

Source

unsafe fn from_raw(raw: *mut Self::Interface) -> Self

Creates a wrapper from the raw pointer. Takes ownership of the pointer for reference counting purposes.

Source

unsafe fn from_ptr(ptr: ComPtr<Self::Interface>) -> Self

Creates a wrapper taking ownership of a ComPtr.

Source

unsafe fn into_ptr(self) -> ComPtr<Self::Interface>

Unwraps the wrapper into a ComPtr.

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§