[−][src]Struct comedy::com::ComRef
Wrap COM interfaces sanely
Originally from wio-rs ComPtr
Methods
impl<T> ComRef<T> where
T: Interface,
[src]
T: Interface,
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]
T: Deref<Target = U>,
U: Interface,
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]
U: Interface,
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]
T: Interface,
impl<T> Clone for ComRef<T> where
T: Interface,
[src]
T: Interface,
fn clone(&self) -> Self
[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]
T: Interface,
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,