[][src]Struct mcom::Agile

pub struct Agile<I: Interface + AsIUnknown> { /* fields omitted */ }

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.

impl<I: Interface + AsIUnknown, '_> TryFrom<&'_ Rc<I>> for Agile<I>[src]

type Error = MethodHResult

The type returned in the event of a conversion error.

impl<I: Interface + AsIUnknown> TryFrom<Agile<I>> for Rc<I>[src]

type Error = MethodHResult

The type returned in the event of a conversion error.

impl<I: Interface + AsIUnknown> TryFrom<Rc<I>> for Agile<I>[src]

type Error = MethodHResult

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<I> RefUnwindSafe for Agile<I> where
    I: RefUnwindSafe

impl<I> Unpin for Agile<I> where
    I: Unpin

impl<I> UnwindSafe for Agile<I> where
    I: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.