Struct orb_network_manager::NetworkManager
source · [−]pub struct NetworkManager { /* private fields */ }Implementations
sourceimpl NetworkManager
impl NetworkManager
pub fn new() -> Self
pub fn with_method_timeout(timeout: u64) -> Self
sourcepub fn start_service(timeout: u64) -> Result<ServiceState>
pub fn start_service(timeout: u64) -> Result<ServiceState>
Starts the Network Manager service.
Examples
use network_manager::NetworkManager;
let state = NetworkManager::start_service(10).unwrap();
println!("{:?}", state);sourcepub fn stop_service(timeout: u64) -> Result<ServiceState>
pub fn stop_service(timeout: u64) -> Result<ServiceState>
Stops the Network Manager service.
Examples
use network_manager::NetworkManager;
let state = NetworkManager::stop_service(10).unwrap();
println!("{:?}", state);sourcepub fn get_service_state() -> Result<ServiceState>
pub fn get_service_state() -> Result<ServiceState>
Gets the state of the Network Manager service.
Examples
use network_manager::NetworkManager;
let state = NetworkManager::get_service_state().unwrap();
println!("{:?}", state);sourcepub fn get_connections(&self) -> Result<Vec<Connection>>
pub fn get_connections(&self) -> Result<Vec<Connection>>
Get a list of Network Manager connections sorted by path.
Examples
use network_manager::NetworkManager;
let manager = NetworkManager::new();
let connections = manager.get_connections().unwrap();
println!("{:?}", connections);pub fn get_active_connections(&self) -> Result<Vec<Connection>>
sourcepub fn get_devices(&self) -> Result<Vec<Device>>
pub fn get_devices(&self) -> Result<Vec<Device>>
Get a list of Network Manager devices.
Examples
use network_manager::NetworkManager;
let manager = NetworkManager::new();
let devices = manager.get_devices().unwrap();
println!("{:?}", devices);pub fn get_device_by_interface(&self, interface: &str) -> Result<Device>
pub fn get_state(&self) -> Result<NetworkManagerState>
pub fn get_connectivity(&self) -> Result<Connectivity>
pub fn is_networking_enabled(&self) -> Result<bool>
pub fn is_wireless_enabled(&self) -> Result<bool>
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for NetworkManager
impl !Send for NetworkManager
impl !Sync for NetworkManager
impl Unpin for NetworkManager
impl !UnwindSafe for NetworkManager
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