ComRc

Struct ComRc 

Source
pub struct ComRc<T: ComInterface + ?Sized> { /* private fields */ }
Expand description

Reference counted handle to the ComBox data.

Provides a safe way to handle the unsafe ComBox values.

Implementations§

Source§

impl<T: ComInterface + ?Sized> ComRc<T>

Source

pub unsafe fn attach(itf: ComItf<T>) -> ComRc<T>

Attaches a floating ComItf reference and brings it under managed reference counting.

Does not increment the reference count.

§Safety

Given this does not increment the reference count, it must be used only if the ComItf is one that would leave the reference dangling. If something already owns the ComItf and will do release on it, the drop of the returned ComRc will result in a double-release.

Source

pub fn detach(rc: ComRc<T>) -> ComItf<T>

Attaches a floating ComItf reference and brings it under managed reference counting.

Does not increment the reference count.

Source

pub unsafe fn wrap<TS: TypeSystem>(ptr: InterfacePtr<TS, T>) -> ComRc<T>

Creates a ComItf<T> from a raw type system COM interface pointer..

Does not increment the reference count.

§Safety

The ptr must be owned by us. wrap will not call add_ref on the ptr.

Methods from Deref<Target = ComItf<T>>§

Source

pub fn as_raw_iunknown(&self) -> &ComItf<dyn RawIUnknown>

Source

pub fn as_iunknown(&self) -> &ComItf<dyn IUnknown>

Trait Implementations§

Source§

impl<T: ComInterface + ?Sized> AsRef<ComItf<T>> for ComRc<T>

Source§

fn as_ref(&self) -> &ComItf<T>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<T: ComInterface + ?Sized> Borrow<ComItf<T>> for ComRc<T>

Source§

fn borrow(&self) -> &ComItf<T>

Immutably borrows from an owned value. Read more
Source§

impl<T: ComInterface + ?Sized> Clone for ComRc<T>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: ComInterface + ?Sized> Debug for ComRc<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: ComInterface + ?Sized> Deref for ComRc<T>

Source§

type Target = ComItf<T>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<T: ComInterface + ?Sized> Drop for ComRc<T>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<TS: TypeSystem, I> ExternInput<TS> for ComRc<I>

Source§

type Lease = ComRc<I>

Source§

type Owned = ComRc<I>

Source§

unsafe fn into_foreign_parameter( self, ) -> ComResult<(Self::ForeignType, Self::Lease)>

Safety Read more
Source§

unsafe fn from_foreign_parameter(source: Self::ForeignType) -> ComResult<Self>

Safety Read more
Source§

impl<TS: TypeSystem, I> ExternOutput<TS> for ComRc<I>

Source§

impl<TS: TypeSystem, I> ExternType<TS> for ComRc<I>

Source§

impl<I: ComInterface + ?Sized, T: HasInterface<I>> From<&ComBox<T>> for ComRc<I>

Source§

fn from(combox: &ComBox<T>) -> Self

Converts to this type from the input type.
Source§

impl<T: ComInterface + ?Sized> From<&ComItf<T>> for ComRc<T>

Source§

fn from(source: &ComItf<T>) -> Self

Converts to this type from the input type.
Source§

impl<I: ComInterface + ?Sized, T: HasInterface<I>> From<ComBox<T>> for ComRc<I>

Source§

fn from(source: ComBox<T>) -> ComRc<I>

Converts to this type from the input type.
Source§

impl<T: ComInterface + ?Sized> From<ComRc<T>> for Variant

Source§

fn from(src: ComRc<T>) -> Self

Converts to this type from the input type.
Source§

impl<TS: TypeSystem, T: ComInterface + ?Sized> From<InterfacePtr<TS, T>> for ComRc<T>

Source§

fn from(source: InterfacePtr<TS, T>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<T> Freeze for ComRc<T>
where T: ?Sized,

§

impl<T> RefUnwindSafe for ComRc<T>
where T: RefUnwindSafe + ?Sized,

§

impl<T> !Send for ComRc<T>

§

impl<T> !Sync for ComRc<T>

§

impl<T> Unpin for ComRc<T>
where T: Unpin + ?Sized,

§

impl<T> UnwindSafe for ComRc<T>
where T: UnwindSafe + ?Sized,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ExternDefault for T

Source§

unsafe fn extern_default() -> T

Safety Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.