[−][src]Struct i3status_rs::blocks::net::NetworkDevice
Fields
device: String
device_path: PathBuf
wireless: bool
tun: bool
wg: bool
ppp: bool
Implementations
impl NetworkDevice
[src]
pub fn from_device(device: String) -> Self
[src]
Use the network device device
. Raises an error if a directory for that
device is not found.
pub fn device(&self) -> String
[src]
pub fn default_device() -> Option<String>
[src]
Grab the name of the 'default' device. A default device is usually selected by the network manager and will change when the status of devices change.
pub fn exists(&self) -> Result<bool, Error>
[src]
Check whether the device exists.
pub fn is_up(&self) -> Result<bool, Error>
[src]
Check whether this network device is in the up
state. Note that a
device that is not up
is not necessarily down
.
pub fn tx_bytes(&self) -> Result<u64, Error>
[src]
Query the device for the current tx_bytes
statistic.
pub fn rx_bytes(&self) -> Result<u64, Error>
[src]
Query the device for the current rx_bytes
statistic.
pub fn is_wireless(&self) -> bool
[src]
Checks whether this device is wireless.
pub fn is_vpn(&self) -> bool
[src]
Checks whether this device is vpn network.
pub fn ssid(&self) -> Result<Option<String>, Error>
[src]
Queries the wireless SSID of this device, if it is connected to one.
fn absolute_signal_strength(&self) -> Result<Option<i32>, Error>
[src]
fn relative_signal_strength(&self) -> Result<Option<u32>, Error>
[src]
pub fn ip_addr(&self) -> Result<Option<String>, Error>
[src]
Queries the inet IP of this device (using ip
).
pub fn ipv6_addr(&self) -> Result<Option<String>, Error>
[src]
Queries the inet IPv6 of this device (using ip
).
pub fn bitrate(&self) -> Result<Option<String>, Error>
[src]
Queries the bitrate of this device
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for NetworkDevice
[src]
impl Send for NetworkDevice
[src]
impl Sync for NetworkDevice
[src]
impl Unpin for NetworkDevice
[src]
impl UnwindSafe for NetworkDevice
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,