pub struct RouteInfo { /* private fields */ }Expand description
The stream a received route serves and what using it costs: read-only facts on an announcement.
Carried by Announce::route. A route claims capability, not inventory: it says
paths under its prefix are servable, never that any specific broadcast exists. The
common convention is that a publisher announces each broadcast’s exact path with
Producer::route, so subscribers can enumerate broadcasts; a service instead
announces one short prefix with Producer::claim and answers whatever is
requested beneath it.
Applications never build one: a Route takes RouteOptions, and the origin
and the relays fill in the rest.
Implementations§
Source§impl RouteInfo
impl RouteInfo
Sourcepub fn identity(&self) -> &Identity
pub fn identity(&self) -> &Identity
The stream the route serves: routes with one identity serve one continuous
key space, so a subscription resumes from one to another. Pass it to
Consumer::request to pin this stream.
Sourcepub fn cost(&self) -> Cost
pub fn cost(&self) -> Cost
What pulling content via this route costs, accumulated per link: lower wins
among routes of the same link priority and anonymity, with ties broken by a
broadcast published on this origin, then hop length, then a hash of the identity
and the requested path (except for a route that entered here, at its own path),
and finally the most recently announced route. See Cost.
Sourcepub fn available(&self) -> bool
pub fn available(&self) -> bool
Whether a usable path reaches the route’s origin. An unavailable route is held: the network lost every path to it but may recover one, so the announcement stays. It ranks below every available claim of its prefix, a draining one included, though a more specific claim still shadows a broader one, and requests through it may fail until it recovers: request again once it turns available.
Sourcepub fn entered_from(&self) -> Option<u64>
pub fn entered_from(&self) -> Option<u64>
The hop id of the session the route entered this origin from, 0 when that session
named none, or None for a route announced here.
Behind the test-support feature: a test’s door, not an API.
Trait Implementations§
impl Eq for RouteInfo
impl StructuralPartialEq for RouteInfo
Auto Trait Implementations§
impl Freeze for RouteInfo
impl RefUnwindSafe for RouteInfo
impl Send for RouteInfo
impl Sync for RouteInfo
impl Unpin for RouteInfo
impl UnsafeUnpin for RouteInfo
impl UnwindSafe for RouteInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.