pub struct Agile<I: Interface + AsIUnknown> { /* private fields */ }
Expand description
A Send+Sync, IAgileReference-held interface pointer.
Implementations§
Source§impl<I: Interface + AsIUnknown> Agile<I>
impl<I: Interface + AsIUnknown> Agile<I>
Sourcepub fn try_from_eager(unk: impl AsRef<Rc<I>>) -> Result<Self, MethodHResult>
pub fn try_from_eager(unk: impl AsRef<Rc<I>>) -> Result<Self, MethodHResult>
Eagerly marshal a COM interface for use in another apartment. Will fail if this is not possible.
Sourcepub fn try_from_lazy(unk: impl AsRef<Rc<I>>) -> Result<Self, MethodHResult>
pub fn try_from_lazy(unk: impl AsRef<Rc<I>>) -> Result<Self, MethodHResult>
Lazily marshal a COM interface for use in another thread. May fail when converted back into an Rc if in another COM apartment.
Sourcepub fn resolve(&self) -> Result<Rc<I>, MethodHResult>
pub fn resolve(&self) -> Result<Rc<I>, MethodHResult>
[microsoft.com]
Get a COM pointer to I
that is safe to use from the current thread’s COM apartment
Trait Implementations§
impl<I: Interface + AsIUnknown> Send for Agile<I>
impl<I: Interface + AsIUnknown> Sync for Agile<I>
- Types which implement IAgileObject will remain unwrapped
- Types which implement INoMarshal will fail to convert to Agile in the first place
- Types which implement neither will be wrapped in lightweight in-process-only marshaling
Auto Trait Implementations§
impl<I> Freeze for Agile<I>
impl<I> RefUnwindSafe for Agile<I>where
I: RefUnwindSafe,
impl<I> Unpin for Agile<I>
impl<I> UnwindSafe for Agile<I>where
I: RefUnwindSafe,
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