pub enum Declared {
As(&'static str),
Refuses {
seen_by: &'static [&'static str],
reason: &'static str,
},
RefusesUncovered(&'static str),
Invisible(&'static str),
}Expand description
How a serving-side policy reaches the peer.
The three arms are not degrees of quality — they are three different
contracts, and picking the wrong one is the defect. WantPolicy was
implicitly treated as Self::Refuses and was in fact silent: the refusal
happened inside the client, which is the one place a server’s error can
never reach.
Variants§
As(&'static str)
Named on the wire as this capability, so a peer can see it before it asks and shape its request around it.
Required whenever the peer’s behaviour depends on knowing: git’s client
will not send filter, thin-pack or a want for an unadvertised
object unless the corresponding capability was advertised.
Refuses
Not on the wire, and it does not have to be, because when it applies the peer gets an error that says so.
This arm is a claim about something arriving, so it carries the tests that watched it arrive. “It refuses” is only a safe answer if the refusal is observable at the far end; a limit that silently truncates a pack, or that is enforced inside the client, is not this arm.
Fields
RefusesUncovered(&'static str)
The peer gets an error that says so — and nothing in this repository has watched it arrive.
Split out of Refuses on 2026-09-09, because limits was
using that arm while citing three tests at
../edda/crates/storage-git-gix/parked-gix-2/gunnar-wire-gix/tests/fetch_memory.rs.
Two things were wrong with that and only one of them was the sibling path:
parked-gix-2 is quarantined salvage, named by neither edda’s include
list nor any published tarball, so the citation resolved on exactly one
machine and nowhere else. The guard “checks the citation exists”, and what
it was checking was one developer’s disk.
So the uncovered case gets its own name instead of borrowing the covered one’s. The reason must say what the peer sees AND what would cover it — this arm is an admission, and an admission that does not name its way out becomes furniture.
Invisible(&'static str)
Nothing a peer can observe, and here is the argument for why.
The escape hatch, and it has to cost a sentence — the same rule
Honoured::Vacuously carries, for the same reason.