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
sourceimpl<T: ComInterface + ?Sized> ComRc<T>
impl<T: ComInterface + ?Sized> ComRc<T>
sourcepub unsafe fn attach(itf: ComItf<T>) -> ComRc<T>
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.
sourcepub fn detach(rc: ComRc<T>) -> ComItf<T>
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.
sourcepub unsafe fn wrap<TS: TypeSystem>(ptr: InterfacePtr<TS, T>) -> ComRc<T>
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>>
pub fn as_raw_iunknown(&self) -> &ComItf<dyn RawIUnknown>
pub fn as_iunknown(&self) -> &ComItf<dyn IUnknown>
Trait Implementations
sourceimpl<T: ComInterface + ?Sized> Clone for ComRc<T>
impl<T: ComInterface + ?Sized> Clone for ComRc<T>
sourceimpl<T: ComInterface + ?Sized> Debug for ComRc<T>
impl<T: ComInterface + ?Sized> Debug for ComRc<T>
sourceimpl<T: ComInterface + ?Sized> Deref for ComRc<T>
impl<T: ComInterface + ?Sized> Deref for ComRc<T>
sourceimpl<T: ComInterface + ?Sized> Drop for ComRc<T>
impl<T: ComInterface + ?Sized> Drop for ComRc<T>
sourceimpl<TS: TypeSystem, I: ComInterface + ?Sized> ExternInput<TS> for ComRc<I> where
I: ForeignType,
impl<TS: TypeSystem, I: ComInterface + ?Sized> ExternInput<TS> for ComRc<I> where
I: ForeignType,
type Lease = ComRc<I>
sourceunsafe fn into_foreign_parameter(
self
) -> ComResult<(Self::ForeignType, Self::Lease)>
unsafe fn into_foreign_parameter(
self
) -> ComResult<(Self::ForeignType, Self::Lease)>
Safety Read more
type Owned = ComRc<I>
sourceunsafe fn from_foreign_parameter(source: Self::ForeignType) -> ComResult<Self>
unsafe fn from_foreign_parameter(source: Self::ForeignType) -> ComResult<Self>
Safety Read more
sourceimpl<TS: TypeSystem, I: ComInterface + ?Sized> ExternOutput<TS> for ComRc<I> where
I: ForeignType,
impl<TS: TypeSystem, I: ComInterface + ?Sized> ExternOutput<TS> for ComRc<I> where
I: ForeignType,
fn into_foreign_output(self) -> ComResult<Self::ForeignType>
sourceunsafe fn from_foreign_output(source: Self::ForeignType) -> ComResult<Self>
unsafe fn from_foreign_output(source: Self::ForeignType) -> ComResult<Self>
Safety Read more
sourceunsafe fn drop_foreign_output(source: Self::ForeignType)
unsafe fn drop_foreign_output(source: Self::ForeignType)
Safety Read more
sourceimpl<TS: TypeSystem, I: ComInterface + ?Sized> ExternType<TS> for ComRc<I> where
I: ForeignType,
impl<TS: TypeSystem, I: ComInterface + ?Sized> ExternType<TS> for ComRc<I> where
I: ForeignType,
type ForeignType = Option<InterfacePtr<TS, I>>
sourceimpl<I: ComInterface + ?Sized, T: HasInterface<I>> From<&ComBox<T>> for ComRc<I>
impl<I: ComInterface + ?Sized, T: HasInterface<I>> From<&ComBox<T>> for ComRc<I>
sourceimpl<I: ComInterface + ?Sized, T: HasInterface<I>> From<ComBox<T>> for ComRc<I>
impl<I: ComInterface + ?Sized, T: HasInterface<I>> From<ComBox<T>> for ComRc<I>
sourceimpl<TS: TypeSystem, T: ComInterface + ?Sized> From<InterfacePtr<TS, T>> for ComRc<T>
impl<TS: TypeSystem, T: ComInterface + ?Sized> From<InterfacePtr<TS, T>> for ComRc<T>
sourcefn from(source: InterfacePtr<TS, T>) -> Self
fn from(source: InterfacePtr<TS, T>) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl<T: ?Sized> RefUnwindSafe for ComRc<T> where
T: RefUnwindSafe,
impl<T> !Send for ComRc<T>
impl<T> !Sync for ComRc<T>
impl<T: ?Sized> Unpin for ComRc<T> where
T: Unpin,
impl<T: ?Sized> UnwindSafe for ComRc<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ExternDefault for T
impl<T> ExternDefault for T
sourceunsafe fn extern_default() -> T
unsafe fn extern_default() -> T
Safety Read more