Skip to main content

DiscoveryOutcome

Enum DiscoveryOutcome 

Source
pub enum DiscoveryOutcome<T> {
    Found(T),
    Absent,
}
Expand description

What a discovery step found, when the step itself completed.

Spec §8.4.6 turns on a distinction an empty collection can carry but cannot NAME — and while it was carried by prose alone, implementations of this protocol repeatedly got it backwards, in both directions. Absence advances the mechanism sequence; failure stops it. A mechanism that published nothing offered nothing to break, so advancing past it concedes nothing. A mechanism that was offered and then broke must reject, or whoever can break — or merely block — the strongest anchor gets to choose that the verifier trusts a weaker one instead, and choosing the anchor is an identity decision.

Failure is deliberately NOT a variant here. It stays in the Err arm of the enclosing Result, for two reasons. It carries a §11 code the caller acts on — APH_E008 unreachable, APH_E003 outside the validity window, APH_E010 unsupported, APH_E014 terminal absence — and those demand different remedies. And ? then propagates a failure past every intermediate hop with nobody writing the propagation: the no-downgrade rule becomes something the compiler enforces rather than a discipline each call site has to remember, which is exactly where it was lost before.

This type appears only where the protocol defines a served-absence form. The two body-fetch ports have none — see ports for why inventing one there would both contradict §6.3.3.4 and make a response status readable from outside a verifier.

Variants§

§

Found(T)

The mechanism answered, and it published this.

§

Absent

The mechanism answered, and the answer is that nothing is published here. An ordered chain ADVANCES to the next mechanism; a chain of one — a pinned or terminal mechanism — has nowhere to advance to and reports APH_E014.

Trait Implementations§

Source§

impl<T: Clone> Clone for DiscoveryOutcome<T>

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<T: Debug> Debug for DiscoveryOutcome<T>

Source§

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

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

impl<T: Eq> Eq for DiscoveryOutcome<T>

Source§

impl<T: PartialEq> PartialEq for DiscoveryOutcome<T>

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<T: PartialEq> StructuralPartialEq for DiscoveryOutcome<T>

Auto Trait Implementations§

§

impl<T> Freeze for DiscoveryOutcome<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for DiscoveryOutcome<T>
where T: RefUnwindSafe,

§

impl<T> Send for DiscoveryOutcome<T>
where T: Send,

§

impl<T> Sync for DiscoveryOutcome<T>
where T: Sync,

§

impl<T> Unpin for DiscoveryOutcome<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for DiscoveryOutcome<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for DiscoveryOutcome<T>
where T: UnwindSafe,

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, 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.