pub struct Agreement { /* private fields */ }Expand description
Both sides, and what the bridge can therefore serve.
Implementations§
Source§impl Agreement
impl Agreement
Sourcepub fn between(downstream: Leg, upstream: Leg) -> Self
pub fn between(downstream: Leg, upstream: Leg) -> Self
Reconciles two independently negotiated legs.
Pure and total: any two legs produce an agreement, including two that share no features at all. Refusing to build one in that case would leave the caller with nothing to report on, and “nothing in common” is exactly the situation where an operator most needs to be told.
Sourcepub const fn downstream(&self) -> &Leg
pub const fn downstream(&self) -> &Leg
The client side of the bridge.
Sourcepub const fn served(&self) -> FeatureProfile
pub const fn served(&self) -> FeatureProfile
What the bridge can actually serve: the intersection.
This is what gets advertised downstream. Anything else is a promise the bridge cannot keep.
Sourcepub fn serves(&self, feature: Feature) -> bool
pub fn serves(&self, feature: Feature) -> bool
Whether feature can be served, in both directions.
Sourcepub fn same_version(&self) -> bool
pub fn same_version(&self) -> bool
Whether the two sides settled on the same revision.
Not required for a bridge — translating between revisions is its whole
purpose — but a bridge answering true has nothing to translate and is
usually a misconfiguration, so it is worth asking.