Skip to main content

SelfNetwork

Struct SelfNetwork 

Source
pub struct SelfNetwork {
    pub online: bool,
    pub home_relay: Option<String>,
    pub relays: Vec<RelayInfo>,
    pub direct_addrs: Vec<String>,
    pub last_change_epoch: Option<i64>,
    pub identity_conflict_epoch: Option<i64>,
}
Expand description

The status.self_network block (#90): THIS node’s own reachability posture — the first question in every “my message never arrived” investigation, previously unanswerable from either side of the API. Self-facing only: everything here is the node’s own information (relay URLs come from its own config, sanitized; direct addresses already ride its invites).

online is iroh’s own semantics — a home-relay connection is established. In relay_mode = "disabled" it is ALWAYS false with an empty relays list: that is a configuration, not an outage — render it as “LAN-only”, never as a health warning.

Additive-only.

Default is {online: false, relays: []} — which is exactly the shape above meaning “deliberately LAN-only” (#148). The porcelain reads it that way and SUPPRESSES the “no relay connection” line for it. So a fixture built with ..Default::default() claims a healthy LAN-only posture, not an unknown one. There is no third value for a bool; the honest way to say “nobody looked” is StatusResult.self_network: None, which is what a defaulted StatusResult gives you.

Fields§

§online: bool

A home-relay connection is established (iroh’s online definition). The signal #53’s set_relays never had: when this goes false on a relay-enabled node, the relay set is the thing to look at.

§home_relay: Option<String>

The CONNECTED home relay’s URL, sanitized to scheme + host + port (operator-supplied relay URLs can carry userinfo tokens; status output gets screenshotted). None when no relay is connected.

§relays: Vec<RelayInfo>

Every known home relay and its current connection state. Empty when no relays are configured, or before the endpoint has selected any.

§direct_addrs: Vec<String>

This endpoint’s direct (non-relay) socket addresses — its own dialable coordinates.

§last_change_epoch: Option<i64>

When the daemon’s watcher last observed a TRANSITION (epoch seconds) — a change of online, home_relay, or a relay’s connection state; direct_addrs drift alone does not stamp (nor emit a frame). OMITTED (not null) until the first observed transition after boot, and from a point-in-time computation with no watcher running.

§identity_conflict_epoch: Option<i64>

When the relay last reported that ANOTHER endpoint is presenting this node’s identity (#134, epoch seconds), or absent if never — the overwhelmingly common case.

Two nodes booted from COPIES of one mesh root share an endpoint id. The relay can serve only one, so the displaced node’s peers simply go unreachable with nothing saying why; diagnosing that cost a downstream real time. This is that missing “why”.

Sticky, and a timestamp rather than a flag. The condition is announced once, as the displaced connection is dropped — it is not a state the relay keeps reporting — so a self-clearing flag would read false by the time anyone called status. Judge staleness from the epoch, exactly as with last_change_epoch.

Absence is not proof of uniqueness. Detection needs an IdentityConflictLayer in the process’s tracing subscriber: the standalone daemon installs one at boot, but an EMBEDDED node cannot (a subscriber is global and the host owns it) and reports None until the host installs it. Never render absence as “identity verified unique”.

Additive: #[serde(default, skip_serializing_if = "Option::is_none")]. api_minor >= 32.

Trait Implementations§

Source§

impl Clone for SelfNetwork

Source§

fn clone(&self) -> SelfNetwork

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 Debug for SelfNetwork

Source§

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

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

impl Default for SelfNetwork

Source§

fn default() -> SelfNetwork

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for SelfNetwork

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for SelfNetwork

Source§

impl PartialEq for SelfNetwork

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl Serialize for SelfNetwork

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for SelfNetwork

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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