ComItf

Struct ComItf 

Source
pub struct ComItf<T>
where T: ?Sized,
{ /* private fields */ }
Expand description

An incoming COM interface pointer.

Intercom will implement the various [com_interface] traits for the corresponding ComItf<T> type.

This applies only to the pure interfaces. Implicit interfaces created through #[com_interface] impl MyStruct constructs are not supported for ComItf<T>.

Implementations§

Source§

impl<T: ?Sized> ComItf<T>

Source

pub fn new( automation: InterfacePtr<AutomationTypeSystem, T>, raw: InterfacePtr<RawTypeSystem, T>, ) -> ComItf<T>

Creates a ComItf<T> from a raw type system COM interface pointer..

Source

pub fn maybe_new( automation: Option<InterfacePtr<AutomationTypeSystem, T>>, raw: Option<InterfacePtr<RawTypeSystem, T>>, ) -> Option<ComItf<T>>

Creates a ComItf<T> from a raw type system COM interface pointer..

Source

pub unsafe fn wrap<TS: TypeSystem>(ptr: InterfacePtr<TS, T>) -> ComItf<T>

Creates a ComItf<T> from a raw type system COM interface pointer..

§Safety

The ComItf must not outlast the reference owned by the provided pointer.

Source

pub fn ptr<TS: TypeSystem>(this: &Self) -> Option<InterfacePtr<TS, T>>

Gets the raw COM pointer from the ComItf<T>.

Source

pub fn as_raw_iunknown(&self) -> &ComItf<dyn RawIUnknown>

Source

pub fn as_iunknown(&self) -> &ComItf<dyn IUnknown>

Source§

impl<T: ComInterface + ?Sized> ComItf<T>

Source

pub fn query_interface<TTarget: ComInterface + ?Sized>( this: &Self, ) -> ComResult<ComRc<TTarget>>

Query interface on the ComItf.

Source

pub fn as_rc(this: &Self) -> ComRc<T>

Trait Implementations§

Source§

impl<T: ComInterface + ?Sized> AsRef<ComItf<T>> for ComRc<T>

Source§

fn as_ref(&self) -> &ComItf<T>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<T: ComInterface + ?Sized> Borrow<ComItf<T>> for ComRc<T>

Source§

fn borrow(&self) -> &ComItf<T>

Immutably borrows from an owned value. Read more
Source§

impl<T: ?Sized> Debug for ComItf<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: ComInterface + ?Sized> Deref for ComItf<T>

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &T

Dereferences the value.
Source§

impl<'a, TS: TypeSystem, I> ExternInput<TS> for &'a ComItf<I>

Source§

type Lease = ()

Source§

type Owned = ComItf<I>

Source§

unsafe fn into_foreign_parameter( self, ) -> ComResult<(Self::ForeignType, Self::Lease)>

Safety Read more
Source§

unsafe fn from_foreign_parameter( source: Self::ForeignType, ) -> ComResult<Self::Owned>

Safety Read more
Source§

impl<'a, TS: TypeSystem, I> ExternType<TS> for &'a ComItf<I>

Source§

impl<T: ComInterface + ?Sized> From<&ComItf<T>> for ComRc<T>

Source§

fn from(source: &ComItf<T>) -> Self

Converts to this type from the input type.
Source§

impl<T: ComInterface + ?Sized> From<&ComItf<T>> for Variant

Source§

fn from(src: &ComItf<T>) -> Self

Converts to this type from the input type.
Source§

impl<I: ComInterface + IAllocator + ?Sized> IAllocator for ComItf<I>

Source§

unsafe fn alloc(&self, len: usize) -> *mut c_void

Allocates a segment of memory that is safe to pass through intercom interfaces. Read more
Source§

unsafe fn alloc_bstr(&self, text: *const u16, len: u32) -> BSTR

Allocates a new BSTR based on an existing string value. Read more
Source§

unsafe fn free(&self, ptr: *mut c_void)

Frees a segment of memory received through intercom interfaces. Read more
Source§

unsafe fn free_bstr(&self, bstr: BSTR)

Frees a BSTR value. Read more
Source§

impl<I: ComInterface + IClassFactory + ?Sized> IClassFactory for ComItf<I>

Source§

unsafe fn create_instance( &self, outer: RawComPtr, riid: REFIID, ) -> ComResult<RawComPtr>

Safety Read more
Source§

fn lock_server(&self, lock: bool) -> ComResult<()>

Source§

impl<I: ComInterface + IErrorInfo + ?Sized> IErrorInfo for ComItf<I>

Source§

impl<I: ComInterface + IErrorStore + ?Sized> IErrorStore for ComItf<I>

Source§

impl<I: ComInterface + IIntercomCoClass + ?Sized> IIntercomCoClass for ComItf<I>

Source§

impl<I: ComInterface + IIntercomInterface + ?Sized> IIntercomInterface for ComItf<I>

Source§

impl<I: ComInterface + IIntercomInterfaceVariant + ?Sized> IIntercomInterfaceVariant for ComItf<I>

Source§

impl<I: ComInterface + IIntercomMethod + ?Sized> IIntercomMethod for ComItf<I>

Source§

impl<I: ComInterface + IIntercomTypeInfo + ?Sized> IIntercomTypeInfo for ComItf<I>

Source§

impl<I: ComInterface + IIntercomTypeLib + ?Sized> IIntercomTypeLib for ComItf<I>

Source§

impl<I: ComInterface + ISupportErrorInfo + ?Sized> ISupportErrorInfo for ComItf<I>

Source§

fn interface_supports_error_info(&self, riid: REFIID) -> HRESULT

Informs the current COM class supports IErrorInfo for a specific interface. Read more
Source§

impl<I: ComInterface + RawIUnknown + ?Sized> RawIUnknown for ComItf<I>

Source§

fn add_ref(&self) -> u32

Increments the reference count of the object. Read more
Source§

fn query_interface(&self, riid: REFIID) -> RawComResult<RawComPtr>

Tries to get a different COM interface for the current object. Read more
Source§

fn release(&self) -> u32

Decreases the reference count of the object. Read more
Source§

impl<T: ComInterface + ?Sized> ToOwned for ComItf<T>

Source§

type Owned = ComRc<T>

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> Self::Owned

Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · Source§

fn clone_into(&self, target: &mut Self::Owned)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<I: ComInterface + IUnknown + ?Sized> IUnknown for ComItf<I>

Auto Trait Implementations§

§

impl<T> Freeze for ComItf<T>
where T: ?Sized,

§

impl<T> RefUnwindSafe for ComItf<T>
where T: RefUnwindSafe + ?Sized,

§

impl<T> !Send for ComItf<T>

§

impl<T> !Sync for ComItf<T>

§

impl<T> Unpin for ComItf<T>
where T: Unpin + ?Sized,

§

impl<T> UnwindSafe for ComItf<T>
where T: UnwindSafe + ?Sized,

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> ExternDefault for T

Source§

unsafe fn extern_default() -> T

Safety Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.