pub struct AcpFeatureProfile {
pub version: AcpVersion,
pub features: [bool; 7],
}Expand description
A capability profile negotiated at session startup.
Carries the negotiated version, the agent’s capabilities, the editor’s capabilities, and the per-feature bitset. The bitset is the answer to “may code path X run right now?”.
§Why a Copy newtype around a fixed-size array
The array is Copy because its element is bool
(which is Copy). A profile is a snapshot of the
negotiation result; it is small, cheap to copy,
and lives on the stack. The AcpFeatureProfile is
what the dispatcher’s gate checks against on the
hot path; a Copy shape keeps that check an array
lookup, not a pointer chase.
Fields§
§version: AcpVersionThe negotiated version. AcpVersion::Unknown
means a future release the build has not seen
the codec for; the dispatcher still gates on
the bitset.
features: [bool; 7]The per-feature bitset, indexed by AcpFeature::ALL.
Implementations§
Source§impl AcpFeatureProfile
impl AcpFeatureProfile
Sourcepub const EMPTY: Self
pub const EMPTY: Self
A profile with every feature off. Useful as a default before negotiation completes.
Sourcepub const V1_25_0: Self
pub const V1_25_0: Self
The canonical v1.25.0 profile: every method
meta.json lists is on, because the v1.25.0
schema is the union of those methods. An agent
built on this build that wants to drop a
method constructs a profile with the relevant
bit off.
Sourcepub const fn supports(self, feature: AcpFeature) -> bool
pub const fn supports(self, feature: AcpFeature) -> bool
Returns true if the feature is on. The
dispatcher gates every feature-specific code
path through this method; an off feature is
the typed error path.