Struct orb_network_manager::Device
source · [−]pub struct Device { /* private fields */ }Implementations
sourceimpl Device
impl Device
pub fn device_type(&self) -> &DeviceType
pub fn interface(&self) -> &str
pub fn get_state(&self) -> Result<DeviceState>
pub fn as_wifi_device(&self) -> Option<WiFiDevice<'_>>
sourcepub fn connect(&self) -> Result<DeviceState>
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();sourcepub fn disconnect(&self) -> Result<DeviceState>
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
Auto Trait Implementations
impl !RefUnwindSafe for Device
impl !Send for Device
impl !Sync for Device
impl Unpin for Device
impl !UnwindSafe for Device
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more