pub struct AvailabilityAnswer {
pub available: bool,
pub roots: Option<Vec<HexId>>,
pub total_length: Option<u64>,
pub chunk_count: Option<u64>,
pub complete: Option<bool>,
pub providers: Option<Vec<Provider>>,
pub absence_established: Option<bool>,
}Expand description
One availability answer. Only the fields relevant to the query’s granularity are populated.
Fields§
§available: boolWhether this node holds the queried item.
roots: Option<Vec<HexId>>The roots held (store-granularity queries only).
total_length: Option<u64>The full resource ciphertext length (resource-granularity only).
chunk_count: Option<u64>The chunk count (resource-granularity only).
complete: Option<bool>Whether the whole item is held (root/resource-granularity only).
providers: Option<Vec<Provider>>Providers that hold the item — present on a miss when holders were located (enriched answer).
absence_established: Option<bool>Whether this responder actually ESTABLISHED that nobody holds the item.
Only meaningful beside available: false; on a hit the item is held and there
is nothing to establish.
§Absent is a THIRD state, not false
Some(true)— the responder looked, reached everything it meant to reach, and asserts absence. A client MAY stop searching.Some(false)— the responder looked and could NOT establish absence: a hop timed out, was unreachable, or refused uninformatively. A client MUST keep looking. This is the in-band form ofContentMissInconclusive, for a batch where only SOME items were inconclusive and the call itself therefore succeeded.None— the responder predates this field and makes NO claim either way. It is NOTSome(false):Some(false)is a responder telling you its search was incomplete, whileNoneis a responder that cannot describe its search at all. Conflating them lets an older server every miss be read as a positive report of incompleteness; conflating it the other way (unwrap_or(true)) turns an unknown into an assertion of absence. Read it throughabsence_established_or_unknown, which keeps the three states distinct.
Implementations§
Source§impl AvailabilityAnswer
impl AvailabilityAnswer
Sourcepub fn absence_established_or_unknown(&self) -> Option<bool>
pub fn absence_established_or_unknown(&self) -> Option<bool>
Whether absence was established, as a THREE-state answer: Some(true)
asserted, Some(false) explicitly not established, None unknown because the
responder predates the field.
A pass-through, and that is the point — it is the named home for the rule that
there is no safe collapse to bool. A client that wants to stop searching MUST
require Some(true).
Trait Implementations§
Source§impl Clone for AvailabilityAnswer
impl Clone for AvailabilityAnswer
Source§fn clone(&self) -> AvailabilityAnswer
fn clone(&self) -> AvailabilityAnswer
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more