pub struct ComPtr(/* private fields */);Expand description
An owned reference to a COM object.
Releases on drop and adds a reference on clone, so ownership follows Rust’s rules rather than the caller’s memory.
Implementations§
Source§impl ComPtr
impl ComPtr
Sourcepub unsafe fn adopt(raw: *mut c_void) -> Option<Self>
pub unsafe fn adopt(raw: *mut c_void) -> Option<Self>
Adopt a pointer the callee already added a reference for — which is the
convention for every [out] parameter and return value in COM.
§Safety
raw must be null or a COM interface pointer owned at +1.
pub fn as_raw(&self) -> *mut c_void
Trait Implementations§
impl Send for ComPtr
impl Sync for ComPtr
Auto Trait Implementations§
impl Freeze for ComPtr
impl RefUnwindSafe for ComPtr
impl Unpin for ComPtr
impl UnsafeUnpin for ComPtr
impl UnwindSafe for ComPtr
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more