pub struct Network { /* private fields */ }Expand description
Networking from NetworkManager, from cx.network(). Cloning it is
cheap.
Implementations§
Source§impl Network
impl Network
Sourcepub fn wifi_enabled(&self) -> ReadSignal<bool>
pub fn wifi_enabled(&self) -> ReadSignal<bool>
Whether Wi-Fi is on. false while NetworkManager isn’t running.
Sourcepub fn devices(&self) -> ReadSignal<Vec<NetworkDevice>>
pub fn devices(&self) -> ReadSignal<Vec<NetworkDevice>>
Every device but loopback and those NetworkManager doesn’t manage, in NetworkManager’s numbering. Empty while it isn’t running.
Sourcepub fn wifi_networks(&self) -> ReadSignal<Vec<WifiNetwork>>
pub fn wifi_networks(&self) -> ReadSignal<Vec<WifiNetwork>>
The Wi-Fi networks each device sees, one per name and device, strongest first. Hidden networks are left out. Empty while NetworkManager isn’t running.
Sourcepub fn set_wifi_enabled(&self, enabled: bool)
pub fn set_wifi_enabled(&self, enabled: bool)
Turns Wi-Fi on or off.
Sourcepub fn scan(&self, device: &str)
pub fn scan(&self, device: &str)
Asks the Wi-Fi device at device, its path, to look for networks.
NetworkManager refuses a scan right after another, and that is
logged.
Sourcepub fn connect(&self, network: &WifiNetwork, password: Option<&str>)
pub fn connect(&self, network: &WifiNetwork, password: Option<&str>)
Connects network’s device to it. Without a password,
NetworkManager uses a connection saved for it, and refuses if it has
none. With one, it saves a new WPA connection and uses that. A
refusal is logged, never the password.
Sourcepub fn disconnect(&self, device: &str)
pub fn disconnect(&self, device: &str)
Disconnects the device at device, until it is connected again.