pub struct CapabilitySpec { /* private fields */ }Expand description
The normalized value produced by IntoCapability.
A spec always activates exactly one CapabilityRef. With the
definition feature it may also carry the matching code-defined
Definition that the host must register.
Applications normally construct specs by converting a CapabilityRef, a
typed built-in value, or a Definition.
Duplicate IDs are never merged and later registrations never overwrite earlier ones. The consuming boundary rejects duplicates after resolving built-in aliases, including a reference paired with a code-defined implementation and an implementation that would shadow a built-in.
Implementations§
Source§impl CapabilitySpec
impl CapabilitySpec
Sourcepub fn reference(reference: CapabilityRef) -> Self
pub fn reference(reference: CapabilityRef) -> Self
Normalize a dynamic capability reference.
Sourcepub fn definition(definition: Definition) -> Self
pub fn definition(definition: Definition) -> Self
Normalize a code-defined capability and activate its stable ID.
Sourcepub fn capability_ref(&self) -> &CapabilityRef
pub fn capability_ref(&self) -> &CapabilityRef
The reference that will be activated for the agent.
Sourcepub fn into_parts(self) -> CapabilitySpecParts
pub fn into_parts(self) -> CapabilitySpecParts
Split the spec into its reference and optional code-defined implementation for host consumption.
Trait Implementations§
Source§impl Clone for CapabilitySpec
impl Clone for CapabilitySpec
Source§fn clone(&self) -> CapabilitySpec
fn clone(&self) -> CapabilitySpec
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CapabilitySpec
impl Debug for CapabilitySpec
Source§impl From<CapabilityRef> for CapabilitySpec
impl From<CapabilityRef> for CapabilitySpec
Source§fn from(reference: CapabilityRef) -> Self
fn from(reference: CapabilityRef) -> Self
Source§impl From<Definition> for CapabilitySpec
Available on crate feature definition only.
impl From<Definition> for CapabilitySpec
definition only.