pub struct CapabilityDocument {
pub protocol_version: String,
pub profiles: Vec<String>,
pub features: BTreeMap<String, bool>,
pub limits: BTreeMap<String, u64>,
}Expand description
A deployment’s self-description (API spec, “Capability discovery”).
A remote client fetches this from GET /v0/capabilities and caches it; an
embedded engine exposes the same document as a constant. SDK gating logic
is therefore identical for both backends: check supports or
has_profile, and treat a not_supported error as authoritative when
the two disagree.
Fields§
§protocol_version: StringThe protocol generation, currently v0.
profiles: Vec<String>Advertised profiles, each plane/version. All-or-nothing: every
required op of an advertised profile is implemented.
features: BTreeMap<String, bool>Named features and whether this deployment supports them. An absent key means unsupported.
limits: BTreeMap<String, u64>Advisory numeric limits clients may use to pre-validate requests.
Implementations§
Source§impl CapabilityDocument
impl CapabilityDocument
Sourcepub fn has_profile(&self, profile: &str) -> bool
pub fn has_profile(&self, profile: &str) -> bool
Whether a profile (for example core/v0) is advertised.
Sourcepub fn supports(&self, feature: &str) -> bool
pub fn supports(&self, feature: &str) -> bool
Whether a feature is advertised as supported. Absent keys are unsupported.
Sourcepub fn validate(&self) -> Result<(), CapabilityDocumentError>
pub fn validate(&self) -> Result<(), CapabilityDocumentError>
Checks the feature-key rule (API spec, “Capability discovery”): every feature key’s first dotted segment must be the plane name of an advertised profile.
Sourcepub fn retain_well_formed(&mut self)
pub fn retain_well_formed(&mut self)
Drops feature keys that violate the feature-key rule, the client-side “ignore” handling for malformed documents.
Trait Implementations§
Source§impl Clone for CapabilityDocument
impl Clone for CapabilityDocument
Source§fn clone(&self) -> CapabilityDocument
fn clone(&self) -> CapabilityDocument
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more