Trait intercom::IUnknown [] [src]

pub trait IUnknown {
    fn query_interface(&self, riid: REFIID) -> ComResult<RawComPtr>;
fn add_ref(&self) -> u32;
fn release(&self) -> u32; }

The IUnknown COM interface.

All COM interfaces must inherit from IUnknown interface directly or indirectly. The interface provides the basis of COM reference counting and interface discovery.

For Rust code, Intercom implements the interface automatically.

Required Methods

Tries to get a different COM interface for the current object.

COM objects may (and do) implement multiple interfaces. COM defines QueryInterface as the mechanism for acquiring an interface pointer to a different interface the object implements.

  • riid - The IID of the interface to query.

Returns Ok( interface_ptr ) if the object supports the specified interface or Err( E_NOINTERFACE ) if it doesn't.

Increments the reference count of the object.

Returns the reference count after the incrementation.

Decreases the reference count of the object.

Returns the reference count after the decrement.

If the reference count reaches zero, the object will deallocate itself. As the call might deallocate the object, the caller must ensure that the released reference is not used afterwards.

Implementors