Struct InterfaceRef
pub struct InterfaceRef<'a, I>(/* private fields */);Expand description
A borrowed COM interface pointer with the same representation as I.
This type does not adjust the reference count.
Implementations§
§impl<I: Interface> InterfaceRef<'_, I>
impl<I: Interface> InterfaceRef<'_, I>
pub unsafe fn from_raw(ptr: NonNull<c_void>) -> Self
pub unsafe fn from_raw(ptr: NonNull<c_void>) -> Self
Borrows an interface from a raw pointer without changing its reference count.
§Safety
ptr must point to a valid I that remains alive for the inferred lifetime.
pub fn from_interface(interface: &I) -> Self
pub fn from_interface(interface: &I) -> Self
Borrows an interface without calling AddRef.
pub fn to_owned(self) -> I
pub fn to_owned(self) -> I
Calls AddRef and returns an owned interface.
Trait Implementations§
§impl<I> Clone for InterfaceRef<'_, I>
impl<I> Clone for InterfaceRef<'_, I>
impl<I> Copy for InterfaceRef<'_, I>
§impl<I: Debug + Interface> Debug for InterfaceRef<'_, I>
impl<I: Debug + Interface> Debug for InterfaceRef<'_, I>
§impl<I: Interface> Deref for InterfaceRef<'_, I>
impl<I: Interface> Deref for InterfaceRef<'_, I>
§impl<'a, 'i: 'a, I: Interface> From<&'i I> for InterfaceRef<'a, I>
impl<'a, 'i: 'a, I: Interface> From<&'i I> for InterfaceRef<'a, I>
impl<T> Param<T> for InterfaceRef<'_, T>where
T: Type<T>,
Auto Trait Implementations§
impl<'a, I> !Send for InterfaceRef<'a, I>
impl<'a, I> !Sync for InterfaceRef<'a, I>
impl<'a, I> Freeze for InterfaceRef<'a, I>
impl<'a, I> RefUnwindSafe for InterfaceRef<'a, I>
impl<'a, I> Unpin for InterfaceRef<'a, I>
impl<'a, I> UnsafeUnpin for InterfaceRef<'a, I>
impl<'a, I> UnwindSafe for InterfaceRef<'a, I>
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