wasm_capability_contract/capability/vo/capability_descriptor.rs
1//! [`CapabilityDescriptor`] — a registry entry describing one capability's dispatch shape.
2
3use crate::CapabilityProtocol;
4
5/// What a `CapabilityRegistry` returns for one capability name: the host
6/// import name a granted, structurally-present capability wires to, and
7/// which dispatcher family handles it.
8///
9/// Registry-internal, never serialized — see [`CapabilityProtocol`]'s own
10/// doc comment for why.
11#[derive(Debug, Clone, Copy, PartialEq, Eq)]
12pub struct CapabilityDescriptor {
13 /// The Wasm component-level import name this capability wires to
14 /// (e.g. `"http-egress"`), matched against the component's own
15 /// declared imports by the structural byte-ABI check.
16 pub import_name: &'static str,
17 /// Which dispatcher family resolves a call to this capability.
18 pub protocol: CapabilityProtocol,
19}