[−][src]Struct mcom::Agile
A Send+Sync, IAgileReference-held interface pointer.
Implementations
impl<I: Interface + AsIUnknown> Agile<I>
[src]
pub fn try_from_eager(unk: impl AsRef<Rc<I>>) -> Result<Self, MethodHResult>
[src]
Eagerly marshal a COM interface for use in another apartment. Will fail if this is not possible.
pub fn try_from_lazy(unk: impl AsRef<Rc<I>>) -> Result<Self, MethodHResult>
[src]
Lazily marshal a COM interface for use in another thread. May fail when converted back into an Rc if in another COM apartment.
pub fn resolve(&self) -> Result<Rc<I>, MethodHResult>
[src]
[docs.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> AsRef<Agile<I>> for Agile<I>
[src]
impl<I: Interface + AsIUnknown> Send for Agile<I>
[src]
impl<I: Interface + AsIUnknown> Sync for Agile<I>
[src]
Safety
The entire point of an IAgileReference, like Agile contains is that it can be safely shared between multiple threads, even if they don't belong to the same COM apartment, even if the original interface pointer was apartment-specific. As such, Agile should be safe to mark Send+Sync.
- 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
impl<I: Interface + AsIUnknown, '_> TryFrom<&'_ Agile<I>> for Rc<I>
[src]
type Error = MethodHResult
The type returned in the event of a conversion error.
pub fn try_from(value: &Agile<I>) -> Result<Self, Self::Error>
[src]
impl<I: Interface + AsIUnknown, '_> TryFrom<&'_ Rc<I>> for Agile<I>
[src]
type Error = MethodHResult
The type returned in the event of a conversion error.
pub fn try_from(value: &Rc<I>) -> Result<Self, Self::Error>
[src]
impl<I: Interface + AsIUnknown> TryFrom<Agile<I>> for Rc<I>
[src]
type Error = MethodHResult
The type returned in the event of a conversion error.
pub fn try_from(value: Agile<I>) -> Result<Self, Self::Error>
[src]
impl<I: Interface + AsIUnknown> TryFrom<Rc<I>> for Agile<I>
[src]
Auto Trait Implementations
impl<I> RefUnwindSafe for Agile<I> where
I: RefUnwindSafe,
I: RefUnwindSafe,
impl<I> Unpin for Agile<I> where
I: Unpin,
I: Unpin,
impl<I> UnwindSafe for Agile<I> where
I: UnwindSafe,
I: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,