pub struct Capability {
pub name: &'static str,
pub main_denial: Option<&'static str>,
pub summary: &'static str,
pub filter_fields: &'static [FilterField],
pub example_filter: &'static str,
}Expand description
One gated capability and the policy filter: surface it exposes.
Fields§
§name: &'static strThe name passed to check() — exactly what a policy rule’s
capability: must equal (capability names are matched verbatim).
main_denial: Option<&'static str>Why the runtime refuses this capability to main outright, ahead of the
policy engine — None for an ordinary capability a rule can grant to any
caller. A rule granting a marked capability to main is dead, so the
surfaces that scaffold, add, and lint rules read this one fact rather
than each restating the carve-out, and each shows the reason verbatim.
summary: &'static strOne-line description of what gating the capability controls.
filter_fields: &'static [FilterField]Context fields a filter: expression can match on, as supplied by a
representative call. Documents what a rule can constrain.
example_filter: &'static strA ready-to-uncomment example filter: expression for the scaffold.
Implementations§
Source§impl Capability
impl Capability
Sourcepub fn is_template(&self) -> bool
pub fn is_template(&self) -> bool
Whether the name is a template (mcp.<server>) rather than a concrete
name a policy rule can use verbatim.
Sourcepub fn grantable_to_main(&self) -> bool
pub fn grantable_to_main(&self) -> bool
Whether a policy rule granting this capability to main can take effect.
Sourcepub fn field_names(&self) -> impl Iterator<Item = &'static str>
pub fn field_names(&self) -> impl Iterator<Item = &'static str>
The filter fields’ names, for surfaces that don’t show types.