pub struct Capability {
pub name: &'static str,
pub value: CapValue,
pub offered: Option<&'static str>,
pub honoured: Honoured,
pub requires: Option<WantPolicy>,
}Expand description
One capability gunnar advertises, and the thing that honours it.
Fields§
§name: &'static strThe name as it appears on the wire, without any =value.
value: CapValueWhat follows the name.
offered: Option<&'static str>The Offered knob that can withdraw this capability, if any.
None means it is always advertised. Some(feature) means it appears
only when Offered::has says so — and the parser must refuse the
argument in the same breath, which is what Offered exists to make
impossible to get wrong.
honoured: HonouredWhere it is honoured.
requires: Option<WantPolicy>The [WantPolicy] this row is a promise about, if any.
None for every capability whose truth does not depend on what a
client is allowed to want — which is all of them but the two
allow-*-sha1-in-want rows.
This exists because the drift Honoured catches runs one way only. A
row honoured by nothing is caught by the guard; a policy honoured by
no row is not, because there is no row to look at. WantPolicy was
exactly that: enforced by check_wants on every request and named in no
advertisement, so a stock client refused the request on its own side and
the server never heard it. See [WantPolicy::advertises].