pub struct Connection {
pub id: ConnectionId,
pub medium: Medium,
pub link: Link,
pub addresses: Vec<Addr>,
pub primary_v4: Option<IpAddr>,
pub primary_v6: Option<IpAddr>,
pub v4_lease: Option<DhcpLease>,
pub gateway: Option<Gateway>,
pub dns: Vec<IpAddr>,
pub is_default: bool,
pub default_metric: Option<u32>,
pub profile: Option<Profile>,
}Expand description
A user-facing network connection: one link plus its interpreted state.
Fields§
§id: ConnectionIdStable identifier, preferring the NM profile name over the link name.
medium: MediumWhat kind of connection this is (Ethernet, Wifi, VPN, etc.).
link: LinkThe underlying kernel link, preserved for detail views and jip raw.
addresses: Vec<Addr>Full list of addresses. Rendering uses Connection::primary_v4 /
Connection::primary_v6 by default and collapses the rest.
primary_v4: Option<IpAddr>The single IPv4 to show in the default view.
primary_v6: Option<IpAddr>The single IPv6 to show in the default view. Non-deprecated, global.
v4_lease: Option<DhcpLease>Present when the IPv4 address is dynamic (DHCP).
gateway: Option<Gateway>L3 gateway and its L2 reachability state.
dns: Vec<IpAddr>Per-link resolvers (from resolvectl). Falls back to the stub when
per-link info is unavailable.
is_default: boolTrue when the default route egresses through this connection.
default_metric: Option<u32>Metric of the default route via this connection, if any. Lower = preferred.
profile: Option<Profile>NetworkManager profile metadata, when one is attached.
Trait Implementations§
Source§impl Clone for Connection
impl Clone for Connection
Source§fn clone(&self) -> Connection
fn clone(&self) -> Connection
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more