pub struct CapabilityNegotiation {
pub schema: String,
pub features: BTreeMap<String, bool>,
}Expand description
Peer-advertised protocol feature bitset.
The map is intentionally string-keyed so new additive features can be introduced without a flag-day enum release. Validation still rejects malformed names fail-closed before any negotiated feature is used.
Fields§
§schema: String§features: BTreeMap<String, bool>Implementations§
Source§impl CapabilityNegotiation
impl CapabilityNegotiation
Sourcepub fn v1_default() -> CapabilityNegotiation
pub fn v1_default() -> CapabilityNegotiation
Baseline peer profile: v1 capability tokens only.
Sourcepub fn t1_default() -> CapabilityNegotiation
pub fn t1_default() -> CapabilityNegotiation
T1 peer profile: current capability semantics and anchor batches.
The DELEGATION_CHAIN_BINDING flag is
advertised as true so production peers exercise the
chain-binding check by default. Peers that need to interoperate
with a counterparty that has not rolled out chain-binding can
explicitly clear the flag in the intersected profile, but the
safe direction is to leave it on.
Sourcepub fn supports(&self, feature: &str) -> bool
pub fn supports(&self, feature: &str) -> bool
Return whether a named feature is explicitly advertised.
Sourcepub fn validate(&self) -> Result<(), Error>
pub fn validate(&self) -> Result<(), Error>
Validate schema and feature-name shape before negotiation.
Sourcepub fn negotiated_with(
&self,
remote: &CapabilityNegotiation,
) -> Result<CapabilityNegotiation, Error>
pub fn negotiated_with( &self, remote: &CapabilityNegotiation, ) -> Result<CapabilityNegotiation, Error>
Intersect two negotiated feature sets.
Trait Implementations§
Source§impl Clone for CapabilityNegotiation
impl Clone for CapabilityNegotiation
Source§fn clone(&self) -> CapabilityNegotiation
fn clone(&self) -> CapabilityNegotiation
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more