#[non_exhaustive]pub struct NetworkSnapshot {
pub wifi: RadioState,
pub wwan: RadioState,
pub bluetooth: RadioState,
pub airplane_mode: AirplaneModeState,
pub connectivity: ConnectivityReport,
pub active_connections: Vec<ActiveConnection>,
pub access_points: Vec<AccessPoint>,
pub saved_connections: Vec<SavedConnection>,
pub saved_wifi_profiles: Vec<SavedConnection>,
pub saved_vpn_profiles: Vec<SavedConnection>,
pub wifi_devices: Vec<WifiDevice>,
pub wired_devices: Vec<Device>,
}Expand description
Point-in-time state needed by GUI network applets.
Build this with NetworkManager::snapshot
after receiving a NetworkEvent.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.wifi: RadioStateWi-Fi radio state.
wwan: RadioStateWWAN/mobile broadband radio state.
bluetooth: RadioStateBluetooth radio state.
airplane_mode: AirplaneModeStateAggregated airplane-mode state.
connectivity: ConnectivityReportConnectivity and captive-portal state.
active_connections: Vec<ActiveConnection>Active connections classified for applet rendering.
access_points: Vec<AccessPoint>Visible access points, one entry per BSSID.
saved_connections: Vec<SavedConnection>All saved connection profiles.
saved_wifi_profiles: Vec<SavedConnection>Saved Wi-Fi profiles.
saved_vpn_profiles: Vec<SavedConnection>Saved VPN profiles, including kernel WireGuard profiles.
wifi_devices: Vec<WifiDevice>Wi-Fi device summaries.
wired_devices: Vec<Device>Wired Ethernet devices from the broad device model.
Implementations§
Source§impl NetworkSnapshot
impl NetworkSnapshot
Sourcepub fn wifi_groups(&self) -> Vec<WifiNetworkGroup>
pub fn wifi_groups(&self) -> Vec<WifiNetworkGroup>
Groups visible access points by (interface, ssid) for applet Wi-Fi rows.
Each group keeps every BSSID for advanced UI behavior and exposes the strongest AP as the representative row. Matching saved profiles are attached when their SSID, optional interface binding, and optional BSSID binding match the visible group.
Sourcepub fn known_wifi_by_ssid(&self) -> HashMap<String, Vec<SavedConnectionBrief>>
pub fn known_wifi_by_ssid(&self) -> HashMap<String, Vec<SavedConnectionBrief>>
Returns saved Wi-Fi profiles keyed by SSID.
Duplicate profiles for the same SSID are preserved. Hidden profiles are included when their saved settings contain an SSID, even if no visible AP appears in this snapshot.
Sourcepub fn saved_vpn_map(&self) -> HashMap<String, SavedVpnSummary>
pub fn saved_vpn_map(&self) -> HashMap<String, SavedVpnSummary>
Returns saved VPN profiles keyed by UUID.
Both NetworkManager plugin VPNs and native WireGuard profiles are included. A summary is marked active when a typed active VPN connection has the same UUID.
Sourcepub fn applet_summary(&self) -> AppletNetworkSummary
pub fn applet_summary(&self) -> AppletNetworkSummary
Builds an applet-oriented summary from this snapshot.
This is equivalent to calling Self::wifi_groups,
Self::known_wifi_by_ssid, and Self::saved_vpn_map on the same
snapshot and bundling the results with active connection, connectivity,
and airplane-mode state.
Trait Implementations§
Source§impl Clone for NetworkSnapshot
impl Clone for NetworkSnapshot
Source§fn clone(&self) -> NetworkSnapshot
fn clone(&self) -> NetworkSnapshot
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more