Skip to main content

Interface

Trait Interface 

Source
pub unsafe trait Interface: Sized + Clone {
    const IID: GUID;

    // Provided methods
    fn as_raw(&self) -> *mut c_void { ... }
    fn into_raw(self) -> *mut c_void { ... }
    unsafe fn from_raw(raw: *mut c_void) -> Self { ... }
    unsafe fn from_raw_borrowed(raw: &*mut c_void) -> Option<&Self> { ... }
    fn cast<T>(&self) -> Result<T, Error>
       where T: Interface { ... }
    fn cast_to_any<T>(&self) -> Result<&(dyn Any + 'static), Error>
       where T: ComObjectInner,
             <T as ComObjectInner>::Outer: Any + 'static + IUnknownImpl<Impl = T> { ... }
    fn is_object<T>(&self) -> bool
       where T: ComObjectInner,
             <T as ComObjectInner>::Outer: Any + 'static + IUnknownImpl<Impl = T> { ... }
    fn cast_object_ref<T>(&self) -> Result<&<T as ComObjectInner>::Outer, Error>
       where T: ComObjectInner,
             <T as ComObjectInner>::Outer: Any + 'static + IUnknownImpl<Impl = T> { ... }
    fn cast_object<T>(&self) -> Result<ComObject<T>, Error>
       where T: ComObjectInner,
             <T as ComObjectInner>::Outer: Any + 'static + IUnknownImpl<Impl = T> { ... }
    fn downgrade(&self) -> Result<Weak<Self>, Error> { ... }
    unsafe fn query(
        &self,
        iid: *const GUID,
        interface: *mut *mut c_void,
    ) -> HRESULT { ... }
    fn to_ref(&self) -> InterfaceRef<'_, Self> { ... }
}
Expand description

Provides low-level access to a COM interface vtable.

§Safety

Implementors must be transparent wrappers over an owned COM interface pointer. Vtable and IID must describe that interface, and cloning the wrapper must retain the COM reference.

Required Associated Constants§

Source

const IID: GUID

The GUID associated with the interface.

Provided Methods§

Source

fn as_raw(&self) -> *mut c_void

Returns the borrowed COM interface pointer.

Source

fn into_raw(self) -> *mut c_void

Transfers ownership of the COM interface pointer to the caller.

Source

unsafe fn from_raw(raw: *mut c_void) -> Self

Takes ownership of a COM interface pointer.

§Safety

raw must be owned and point to the vtable for Self, beginning with IUnknown.

Source

unsafe fn from_raw_borrowed(raw: &*mut c_void) -> Option<&Self>

Borrows a COM interface pointer.

§Safety

raw must remain valid and point to the vtable for Self, beginning with IUnknown.

Source

fn cast<T>(&self) -> Result<T, Error>
where T: Interface,

Queries the object for another interface.

Source

fn cast_to_any<T>(&self) -> Result<&(dyn Any + 'static), Error>
where T: ComObjectInner, <T as ComObjectInner>::Outer: Any + 'static + IUnknownImpl<Impl = T>,

Returns the generated outer Rust implementation as [&dyn Any].

Applications should use Interface::cast_object_ref or Interface::cast_object instead.

The reference points to the generated outer type, such as MyApp_Impl, not MyApp.

Returns Err(E_NOINTERFACE) if the object is not a Rust object, not T, or contains non-static lifetimes.

§Safety

This uses a private QueryInterface protocol identified by DYNAMIC_CAST_IID. The implementation writes a two-pointer &dyn Any, not a COM interface pointer, to the output.

The protocol does not call AddRef. The returned reference must not outlive self, and only #[implement]-generated objects may recognize this IID.

Source

fn is_object<T>(&self) -> bool
where T: ComObjectInner, <T as ComObjectInner>::Outer: Any + 'static + IUnknownImpl<Impl = T>,

Returns true if the given COM interface refers to an implementation of T.

Returns false if the object is not a Rust object, not T, or contains non-static lifetimes.

Source

fn cast_object_ref<T>(&self) -> Result<&<T as ComObjectInner>::Outer, Error>
where T: ComObjectInner, <T as ComObjectInner>::Outer: Any + 'static + IUnknownImpl<Impl = T>,

Returns a borrowed reference to the generated outer Rust implementation.

Returns Err(E_NOINTERFACE) if the object is not a Rust object, not T, or contains non-static lifetimes.

The returned value is borrowed; use Interface::cast_object for an owned (counted) reference.

Source

fn cast_object<T>(&self) -> Result<ComObject<T>, Error>
where T: ComObjectInner, <T as ComObjectInner>::Outer: Any + 'static + IUnknownImpl<Impl = T>,

Returns an owned reference to the generated outer Rust implementation.

Returns Err(E_NOINTERFACE) if the object is not a Rust object, not T, or contains non-static lifetimes.

The returned value is an owned (counted) reference: this function calls AddRef. Use Interface::cast_object_ref to avoid AddRef / Release overhead if you do not need ownership.

Source

fn downgrade(&self) -> Result<Weak<Self>, Error>

Attempts to create a Weak reference to this object.

Source

unsafe fn query(&self, iid: *const GUID, interface: *mut *mut c_void) -> HRESULT

Calls QueryInterface.

§Safety

interface must be a non-null, valid pointer for writing an interface pointer.

Source

fn to_ref(&self) -> InterfaceRef<'_, Self>

Borrows this interface without changing its reference count.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Interface for IExtentLogicalLog

Source§

impl Interface for IFabricApplicationHealthResult

Source§

impl Interface for IFabricApplicationManagementClient

Source§

impl Interface for IFabricApplicationManagementClient2

Source§

impl Interface for IFabricApplicationManagementClient3

Source§

impl Interface for IFabricApplicationManagementClient4

Source§

impl Interface for IFabricApplicationManagementClient5

Source§

impl Interface for IFabricApplicationManagementClient6

Source§

impl Interface for IFabricApplicationManagementClient7

Source§

impl Interface for IFabricApplicationManagementClient8

Source§

impl Interface for IFabricApplicationManagementClient9

Source§

impl Interface for IFabricApplicationManagementClient10

Source§

impl Interface for IFabricApplicationManagementClient11

Source§

impl Interface for IFabricApplicationUpgradeProgressResult

Source§

impl Interface for IFabricApplicationUpgradeProgressResult2

Source§

impl Interface for IFabricApplicationUpgradeProgressResult3

Source§

impl Interface for IFabricAsyncOperationCallback

Source§

impl Interface for IFabricAsyncOperationContext

Source§

impl Interface for IFabricAtomicGroupStateProvider

Source§

impl Interface for IFabricAtomicGroupStateReplicator

Source§

impl Interface for IFabricChaosDescriptionResult

Source§

impl Interface for IFabricChaosEventsSegmentResult

Source§

impl Interface for IFabricChaosReportResult

Source§

impl Interface for IFabricChaosScheduleDescriptionResult

Source§

impl Interface for IFabricClientConnectionEventHandler

Source§

impl Interface for IFabricClientConnectionEventHandler2

Source§

impl Interface for IFabricClientSettings

Source§

impl Interface for IFabricClientSettings2

Source§

impl Interface for IFabricClientSettingsResult

Source§

impl Interface for IFabricClusterHealthResult

Source§

impl Interface for IFabricClusterManagementClient

Source§

impl Interface for IFabricClusterManagementClient2

Source§

impl Interface for IFabricClusterManagementClient3

Source§

impl Interface for IFabricClusterManagementClient4

Source§

impl Interface for IFabricClusterManagementClient5

Source§

impl Interface for IFabricClusterManagementClient6

Source§

impl Interface for IFabricClusterManagementClient7

Source§

impl Interface for IFabricClusterManagementClient8

Source§

impl Interface for IFabricClusterManagementClient9

Source§

impl Interface for IFabricClusterManagementClient10

Source§

impl Interface for IFabricClusterManagementClient11

Source§

impl Interface for IFabricClusterManagementClient12

Source§

impl Interface for IFabricClusterManagementClient13

Source§

impl Interface for IFabricClusterManagementClient14

Source§

impl Interface for IFabricClusterManagementClient15

Source§

impl Interface for IFabricClusterManagementClient16

Source§

impl Interface for IFabricCodePackage

Source§

impl Interface for IFabricCodePackage2

Source§

impl Interface for IFabricCodePackageActivationContext

Source§

impl Interface for IFabricCodePackageActivationContext2

Source§

impl Interface for IFabricCodePackageActivationContext3

Source§

impl Interface for IFabricCodePackageActivationContext4

Source§

impl Interface for IFabricCodePackageActivationContext5

Source§

impl Interface for IFabricCodePackageActivationContext6

Source§

impl Interface for IFabricCodePackageActivator

Source§

impl Interface for IFabricCodePackageActivator2

Source§

impl Interface for IFabricCodePackageChangeHandler

Source§

impl Interface for IFabricCodePackageEventHandler

Source§

impl Interface for IFabricConfigurationPackage

Source§

impl Interface for IFabricConfigurationPackage2

Source§

impl Interface for IFabricConfigurationPackageChangeHandler

Source§

impl Interface for IFabricDataPackage

Source§

impl Interface for IFabricDataPackageChangeHandler

Source§

impl Interface for IFabricDeployedApplicationHealthResult

Source§

impl Interface for IFabricDeployedServicePackageHealthResult

Source§

impl Interface for IFabricEseLocalStoreSettingsResult

Source§

impl Interface for IFabricFaultManagementClient

Source§

impl Interface for IFabricFaultManagementClient2

Source§

impl Interface for IFabricFaultManagementClient3

Source§

impl Interface for IFabricGatewayInformationResult

Source§

impl Interface for IFabricGetApplicationListResult

Source§

impl Interface for IFabricGetApplicationListResult2

Source§

impl Interface for IFabricGetApplicationLoadInformationResult

Source§

impl Interface for IFabricGetApplicationNameResult

Source§

impl Interface for IFabricGetApplicationNetworkListResult

Source§

impl Interface for IFabricGetApplicationTypeListResult

Source§

impl Interface for IFabricGetApplicationTypePagedListResult

Source§

impl Interface for IFabricGetBlockListResult

Source§

impl Interface for IFabricGetClusterHealthChunkResult

Source§

impl Interface for IFabricGetClusterLoadInformationResult

Source§

impl Interface for IFabricGetDeployedApplicationListResult

Source§

impl Interface for IFabricGetDeployedApplicationPagedListResult

Source§

impl Interface for IFabricGetDeployedCodePackageListResult

Source§

impl Interface for IFabricGetDeployedNetworkCodePackageListResult

Source§

impl Interface for IFabricGetDeployedNetworkListResult

Source§

impl Interface for IFabricGetDeployedReplicaListResult

Source§

impl Interface for IFabricGetDeployedServicePackageListResult

Source§

impl Interface for IFabricGetDeployedServicePackagePagedListResult

Source§

impl Interface for IFabricGetDeployedServiceReplicaDetailResult

Source§

impl Interface for IFabricGetDeployedServiceTypeListResult

Source§

impl Interface for IFabricGetGetConfigurationOverridesListResult

Source§

impl Interface for IFabricGetGetLoadedPartitionInfoListResult

Source§

impl Interface for IFabricGetNetworkApplicationListResult

Source§

impl Interface for IFabricGetNetworkListResult

Source§

impl Interface for IFabricGetNetworkNodeListResult

Source§

impl Interface for IFabricGetNodeListResult

Source§

impl Interface for IFabricGetNodeListResult2

Source§

impl Interface for IFabricGetNodeLoadInformationResult

Source§

impl Interface for IFabricGetPartitionListResult

Source§

impl Interface for IFabricGetPartitionListResult2

Source§

impl Interface for IFabricGetPartitionLoadInformationResult

Source§

impl Interface for IFabricGetProvisionedCodeVersionListResult

Source§

impl Interface for IFabricGetProvisionedConfigVersionListResult

Source§

impl Interface for IFabricGetRepairTaskListResult

Source§

impl Interface for IFabricGetReplicaListResult

Source§

impl Interface for IFabricGetReplicaListResult2

Source§

impl Interface for IFabricGetReplicaLoadInformationResult

Source§

impl Interface for IFabricGetReplicatorStatusResult

Source§

impl Interface for IFabricGetRollingUpgradeMonitoringPolicyResult

Source§

impl Interface for IFabricGetServiceGroupMemberListResult

Source§

impl Interface for IFabricGetServiceGroupMemberTypeListResult

Source§

impl Interface for IFabricGetServiceListResult

Source§

impl Interface for IFabricGetServiceListResult2

Source§

impl Interface for IFabricGetServiceNameResult

Source§

impl Interface for IFabricGetServiceTypeListResult

Source§

impl Interface for IFabricGetUnplacedReplicaInformationResult

Source§

impl Interface for IFabricHealthClient

Source§

impl Interface for IFabricHealthClient2

Source§

impl Interface for IFabricHealthClient3

Source§

impl Interface for IFabricHealthClient4

Source§

impl Interface for IFabricInfrastructureServiceClient

Source§

impl Interface for IFabricKeyValueStoreEnumerator

Source§

impl Interface for IFabricKeyValueStoreEnumerator2

Source§

impl Interface for IFabricKeyValueStoreItemEnumerator

Source§

impl Interface for IFabricKeyValueStoreItemEnumerator2

Source§

impl Interface for IFabricKeyValueStoreItemMetadataEnumerator

Source§

impl Interface for IFabricKeyValueStoreItemMetadataEnumerator2

Source§

impl Interface for IFabricKeyValueStoreItemMetadataResult

Source§

impl Interface for IFabricKeyValueStoreItemResult

Source§

impl Interface for IFabricKeyValueStoreNotification

Source§

impl Interface for IFabricKeyValueStoreNotificationEnumerator

Source§

impl Interface for IFabricKeyValueStoreNotificationEnumerator2

Source§

impl Interface for IFabricKeyValueStoreReplica

Source§

impl Interface for IFabricKeyValueStoreReplica2

Source§

impl Interface for IFabricKeyValueStoreReplica3

Source§

impl Interface for IFabricKeyValueStoreReplica4

Source§

impl Interface for IFabricKeyValueStoreReplica5

Source§

impl Interface for IFabricKeyValueStoreReplica6

Source§

impl Interface for IFabricKeyValueStoreReplica7

Source§

impl Interface for IFabricKeyValueStoreReplica8

Source§

impl Interface for IFabricManagedIdentityClient

Source§

impl Interface for IFabricManagedIdentityTokenServiceDescription

Source§

impl Interface for IFabricMoveAuxiliaryResult

Source§

impl Interface for IFabricMoveInstanceResult

Source§

impl Interface for IFabricMovePrimaryResult

Source§

impl Interface for IFabricMoveSecondaryResult

Source§

impl Interface for IFabricNameEnumerationResult

Source§

impl Interface for IFabricNetworkManagementClient

Source§

impl Interface for IFabricNodeContextResult

Source§

impl Interface for IFabricNodeContextResult2

Source§

impl Interface for IFabricNodeHealthResult

Source§

impl Interface for IFabricNodeTransitionProgressResult

Source§

impl Interface for IFabricOperation

Source§

impl Interface for IFabricOperationData

Source§

impl Interface for IFabricOperationDataStream

Source§

impl Interface for IFabricOperationStream

Source§

impl Interface for IFabricOperationStream2

Source§

impl Interface for IFabricOrchestrationUpgradeStatusResult

Source§

impl Interface for IFabricPartitionDataLossProgressResult

Source§

impl Interface for IFabricPartitionHealthResult

Source§

impl Interface for IFabricPartitionQuorumLossProgressResult

Source§

impl Interface for IFabricPartitionRestartProgressResult

Source§

impl Interface for IFabricPrimaryReplicator

Source§

impl Interface for IFabricProcessExitHandler

Source§

impl Interface for IFabricPropertyBatchResult

Source§

impl Interface for IFabricPropertyEnumerationResult

Source§

impl Interface for IFabricPropertyManagementClient

Source§

impl Interface for IFabricPropertyManagementClient2

Source§

impl Interface for IFabricPropertyMetadataResult

Source§

impl Interface for IFabricPropertyValueResult

Source§

impl Interface for IFabricQueryClient

Source§

impl Interface for IFabricQueryClient2

Source§

impl Interface for IFabricQueryClient3

Source§

impl Interface for IFabricQueryClient4

Source§

impl Interface for IFabricQueryClient5

Source§

impl Interface for IFabricQueryClient6

Source§

impl Interface for IFabricQueryClient7

Source§

impl Interface for IFabricQueryClient8

Source§

impl Interface for IFabricQueryClient9

Source§

impl Interface for IFabricQueryClient10

Source§

impl Interface for IFabricQueryClient11

Source§

impl Interface for IFabricQueryClient12

Source§

impl Interface for IFabricQueryClient13

Source§

impl Interface for IFabricRepairManagementClient

Source§

impl Interface for IFabricRepairManagementClient2

Source§

impl Interface for IFabricReplicaHealthResult

Source§

impl Interface for IFabricReplicator

Source§

impl Interface for IFabricReplicatorCatchupSpecificQuorum

Source§

impl Interface for IFabricReplicatorSettingsResult

Source§

impl Interface for IFabricResolvedServicePartitionResult

Source§

impl Interface for IFabricRestartDeployedCodePackageResult

Source§

impl Interface for IFabricRestartNodeResult

Source§

impl Interface for IFabricRuntime

Source§

impl Interface for IFabricRuntime2

Source§

impl Interface for IFabricSecondaryEventHandler

Source§

impl Interface for IFabricSecretReferencesResult

Source§

impl Interface for IFabricSecretStoreClient

Source§

impl Interface for IFabricSecretsResult

Source§

impl Interface for IFabricSecurityCredentialsResult

Source§

impl Interface for IFabricSelfReconfiguringConfigurationChangeRequest

Source§

impl Interface for IFabricSelfReconfiguringServiceFactory

Source§

impl Interface for IFabricSelfReconfiguringServiceInstance

Source§

impl Interface for IFabricSelfReconfiguringServicePartition

Source§

impl Interface for IFabricServiceDescriptionResult

Source§

impl Interface for IFabricServiceEndpointsVersion

Source§

impl Interface for IFabricServiceGroupDescriptionResult

Source§

impl Interface for IFabricServiceGroupFactory

Source§

impl Interface for IFabricServiceGroupFactoryBuilder

Source§

impl Interface for IFabricServiceGroupManagementClient

Source§

impl Interface for IFabricServiceGroupManagementClient2

Source§

impl Interface for IFabricServiceGroupManagementClient3

Source§

impl Interface for IFabricServiceGroupManagementClient4

Source§

impl Interface for IFabricServiceGroupPartition

Source§

impl Interface for IFabricServiceHealthResult

Source§

impl Interface for IFabricServiceManagementClient

Source§

impl Interface for IFabricServiceManagementClient2

Source§

impl Interface for IFabricServiceManagementClient3

Source§

impl Interface for IFabricServiceManagementClient4

Source§

impl Interface for IFabricServiceManagementClient5

Source§

impl Interface for IFabricServiceManagementClient6

Source§

impl Interface for IFabricServiceManagementClient7

Source§

impl Interface for IFabricServiceManagementClient8

Source§

impl Interface for IFabricServiceManagementClient9

Source§

impl Interface for IFabricServiceNotification

Source§

impl Interface for IFabricServiceNotificationEventHandler

Source§

impl Interface for IFabricServicePartitionResolutionChangeHandler

Source§

impl Interface for IFabricStartNodeResult

Source§

impl Interface for IFabricStateProvider

Source§

impl Interface for IFabricStateReplicator

Source§

impl Interface for IFabricStateReplicator2

Source§

impl Interface for IFabricStatefulServiceFactory

Source§

impl Interface for IFabricStatefulServicePartition

Source§

impl Interface for IFabricStatefulServicePartition1

Source§

impl Interface for IFabricStatefulServicePartition2

Source§

impl Interface for IFabricStatefulServicePartition3

Source§

impl Interface for IFabricStatefulServiceReplica

Source§

impl Interface for IFabricStatelessServiceFactory

Source§

impl Interface for IFabricStatelessServiceInstance

Source§

impl Interface for IFabricStatelessServicePartition

Source§

impl Interface for IFabricStatelessServicePartition1

Source§

impl Interface for IFabricStatelessServicePartition2

Source§

impl Interface for IFabricStatelessServicePartition3

Source§

impl Interface for IFabricStatelessServicePartition4

Source§

impl Interface for IFabricStopNodeResult

Source§

impl Interface for IFabricStoreEventHandler

Source§

impl Interface for IFabricStoreEventHandler2

Source§

impl Interface for IFabricStorePostBackupHandler

Source§

impl Interface for IFabricStringListResult

Source§

impl Interface for IFabricStringResult

Source§

impl Interface for IFabricTestCommandStatusResult

Source§

impl Interface for IFabricTestManagementClient

Source§

impl Interface for IFabricTestManagementClient2

Source§

impl Interface for IFabricTestManagementClient3

Source§

impl Interface for IFabricTestManagementClient4

Source§

impl Interface for IFabricTestManagementClient5

Source§

impl Interface for IFabricTransaction

Source§

impl Interface for IFabricTransactionBase

Source§

impl Interface for IFabricUpdatePartitionLoadResult

Source§

impl Interface for IFabricUpdatePartitionMoveCostResult

Source§

impl Interface for IFabricUpgradeOrchestrationServiceStateResult

Source§

impl Interface for IFabricUpgradeProgressResult

Source§

impl Interface for IFabricUpgradeProgressResult2

Source§

impl Interface for IFabricUpgradeProgressResult3

Source§

impl Interface for IFabricValidateFabricUpgradeResult

Implementors§