Trait sysinfo::NetworksExt[][src]

pub trait NetworksExt: Debug {
    fn iter(&self) -> NetworksIter<'_>

Notable traits for NetworksIter<'a>

impl<'a> Iterator for NetworksIter<'a> type Item = (&'a String, &'a NetworkData);
;
fn refresh_networks_list(&mut self);
fn refresh(&mut self); }

Interacting with network interfaces.

Required methods

fn iter(&self) -> NetworksIter<'_>

Notable traits for NetworksIter<'a>

impl<'a> Iterator for NetworksIter<'a> type Item = (&'a String, &'a NetworkData);
[src]

Returns an iterator over the network interfaces.

use sysinfo::{NetworkExt, NetworksExt, System, SystemExt};

let s = System::new_all();
let networks = s.get_networks();
for (interface_name, network) in networks {
    println!("in: {} B", network.get_received());
}

fn refresh_networks_list(&mut self)[src]

Refreshes the network interfaces list.

use sysinfo::{NetworksExt, System, SystemExt};

let mut s = System::new_all();
let networks = s.get_networks_mut();
networks.refresh_networks_list();

fn refresh(&mut self)[src]

Refreshes the network interfaces’ content.

use sysinfo::{NetworksExt, System, SystemExt};

let mut s = System::new_all();
let networks = s.get_networks_mut();
networks.refresh();
Loading content...

Implementors

impl NetworksExt for Networks[src]

Loading content...