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>
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.