pub struct CapabilityDocument {
pub protocol_version: String,
pub api_groups: Vec<String>,
pub features: BTreeMap<String, bool>,
pub limits: BTreeMap<String, u64>,
}Expand description
The API groups, features, and limits advertised by a deployment.
Fields§
§protocol_version: StringThe protocol generation, currently v0.
api_groups: Vec<String>The advertised group/version API groups, each with every required operation implemented.
features: BTreeMap<String, bool>The named features supported by this deployment, with absent keys treated as unsupported.
limits: BTreeMap<String, u64>Advisory numeric limits clients may use to pre-validate requests.
Implementations§
Source§impl CapabilityDocument
impl CapabilityDocument
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 direct_put_max_content_bytes(&self) -> Option<u64>
pub fn direct_put_max_content_bytes(&self) -> Option<u64>
The largest object this deployment’s provider accepts in one
direct_put request, when it advertises the limit.
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 group name of an advertised API group.
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.