Skip to main content

Declared

Enum Declared 

Source
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

§seen_by: &'static [&'static str]

<workspace-relative file>::<test fn>, one or more, each of which asserts the peer sees the refusal. Checked to exist.

§reason: &'static str

What the peer actually sees.

§

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.

Trait Implementations§

Source§

impl Clone for Declared

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Declared

Source§

impl Debug for Declared

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Declared

Source§

impl PartialEq for Declared

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Declared

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more