Skip to main content

ComObject

Struct ComObject 

Source
pub struct ComObject<T> { /* private fields */ }
Expand description

One interface of a Rust-implemented COM object as native code sees it (a “COM callable wrapper” of the MicroCom runtime): the first word is the vtable pointer, so a *mut ComObject<T> is the interface pointer; the second leads to the object the wrapper belongs to.

An object has one wrapper per interface it was made with, as the shadow of an object has in the MicroCom runtime. They share the reference count and the value, and QueryInterface on any of them answers with the wrapper of the interface asked for.

Implementations§

Source§

impl<T> ComObject<T>

Source

pub unsafe fn value<'a>(this: *mut c_void) -> &'a T

Recovers the Rust value from the this pointer a thunk receives: the pointer of any interface of the object.

§Safety

this must point at a live ComObject<T>.

Source

pub unsafe fn ref_count(this: *mut c_void) -> u32

Current reference count (diagnostics/tests only).

§Safety

this must point at a live ComObject<T>.

Auto Trait Implementations§

§

impl<T> !Send for ComObject<T>

§

impl<T> !Sync for ComObject<T>

§

impl<T> Freeze for ComObject<T>
where *const Shadow<T>: Freeze,

§

impl<T> RefUnwindSafe for ComObject<T>
where *const Shadow<T>: RefUnwindSafe,

§

impl<T> Unpin for ComObject<T>
where *const Shadow<T>: Unpin,

§

impl<T> UnsafeUnpin for ComObject<T>
where *const Shadow<T>: UnsafeUnpin,

§

impl<T> UnwindSafe for ComObject<T>
where *const Shadow<T>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> IUnknownImpl for T
where T: ?Sized,

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.