[][src]Struct comedy::com::ComRef

#[repr(transparent)]
pub struct ComRef<T>(_)
where
    T: Interface
;

Wrap COM interfaces sanely

Originally from wio-rs ComPtr

Methods

impl<T> ComRef<T> where
    T: Interface
[src]

pub unsafe fn from_raw(ptr: NonNull<T>) -> ComRef<T>[src]

Creates a ComRef to wrap a raw pointer. It takes ownership over the pointer which means it does not call AddRef. T must be a COM interface that inherits from IUnknown.

pub fn up<U>(self) -> ComRef<U> where
    T: Deref<Target = U>,
    U: Interface
[src]

Casts up the inheritance chain

pub fn into_raw(self) -> NonNull<T>[src]

Extracts the raw pointer. You are now responsible for releasing it yourself.

pub fn cast<U>(&self) -> Result<ComRef<U>, HResult> where
    U: Interface
[src]

Get another interface via QueryInterface.

If the call to QueryInterface fails or the resulting interface is null, return an error.

pub fn as_raw(&self) -> NonNull<T>[src]

Obtains the raw pointer without transferring ownership.

Do not release this pointer because it is still owned by the ComRef.

Do not use this pointer beyond the lifetime of the ComRef.

pub fn as_raw_ptr(&self) -> *mut T[src]

Obtains the raw pointer without transferring ownership.

Do not release this pointer because it is still owned by the ComRef.

Do not use this pointer beyond the lifetime of the ComRef.

Trait Implementations

impl<T> Drop for ComRef<T> where
    T: Interface
[src]

impl<T> Clone for ComRef<T> where
    T: Interface
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T> Deref for ComRef<T> where
    T: Interface
[src]

type Target = T

The resulting type after dereferencing.

Auto Trait Implementations

impl<T> !Send for ComRef<T>

impl<T> !Sync for ComRef<T>

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]