pub struct CapabilityStore;
Expand description
The type corresponding to the CapabilityStore protocol. Protocol that represents the concept of a “capability store”, a repository for Capabilitys that are held by the component framework runtime.
CapabilityStore serves as the main bridge between the component runtime and clients that enables them to operate on and exchange Capabilitys. A CapabilityStore instance contains a set of Capabilitys, each of which has a CapabilityId assigned by the client.
Normally, a program would not exchange a CapabilityStore or CapabilityId with other programs – a CapabilityStore connection and its enclosed capabilities are intended to be “local” to a program. Instead, if a program wishes to exchange a Capability with other programs, it should [Export] the Capability out of the store, send the Capability to the target program, which can then [Import] the capability into its own store.
CapabilityStore is also used to manage capability lifetimes. The lifetime of a capability is scoped to the CapabilityStore in which it resides; i.e. to drop the CapabilityStore connections to release the capabilities instead it. In addition, CapabilityStore supports a Drop API to drop an individual Capability reference. (Note that it is possible for a some capabilities, like DictionaryRef, to have multiple references, in which case all of the references must be dropped for the underlying resource to be released.)
A note about semantics: the CapabilityStore APIs do not return CapabilityIds, because CapabilityIds are assigned by the client. Instead, when a method would semantically return a capability, this is expressed by taking the destination CapabilityId as an output parameter.