Struct network_manager::Device [−][src]
pub struct Device { /* fields omitted */ }
Methods
impl Device
[src]
impl Device
pub fn device_type(&self) -> &DeviceType
[src]
pub fn device_type(&self) -> &DeviceType
pub fn interface(&self) -> &str
[src]
pub fn interface(&self) -> &str
pub fn get_state(&self) -> Result<DeviceState>
[src]
pub fn get_state(&self) -> Result<DeviceState>
pub fn as_wifi_device(&self) -> Option<WiFiDevice>
[src]
pub fn as_wifi_device(&self) -> Option<WiFiDevice>
pub fn connect(&self) -> Result<DeviceState>
[src]
pub fn connect(&self) -> Result<DeviceState>
Connects a Network Manager device.
Examples
use network_manager::{NetworkManager, DeviceType}; let manager = NetworkManager::new(); let devices = manager.get_devices().unwrap(); let i = devices.iter().position(|ref d| *d.device_type() == DeviceType::WiFi).unwrap(); devices[i].connect().unwrap();
pub fn disconnect(&self) -> Result<DeviceState>
[src]
pub fn disconnect(&self) -> Result<DeviceState>
Disconnect a Network Manager device.
Examples
use network_manager::{NetworkManager, DeviceType}; let manager = NetworkManager::new(); let devices = manager.get_devices().unwrap(); let i = devices.iter().position(|ref d| *d.device_type() == DeviceType::WiFi).unwrap(); devices[i].disconnect().unwrap();
Trait Implementations
impl Clone for Device
[src]
impl Clone for Device
fn clone(&self) -> Device
[src]
fn clone(&self) -> Device
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Debug for Device
[src]
impl Debug for Device