1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
use super::EthernetDevice;
use crate::gen::OrgFreedesktopNetworkManagerDeviceWired;
use crate::Error;

pub trait Wired {
    fn hw_address(&self) -> Result<String, Error>;
    fn perm_hw_address(&self) -> Result<String, Error>;
    fn speed(&self) -> Result<u32, Error>;
    fn s390_subchannels(&self) -> Result<Vec<String>, Error>;
    fn carrier(&self) -> Result<bool, Error>;
}

impl Wired for EthernetDevice {
    fn hw_address(&self) -> Result<String, Error> {
        Ok(proxy!(self).hw_address()?)
    }
    fn perm_hw_address(&self) -> Result<String, Error> {
        Ok(proxy!(self).perm_hw_address()?)
    }
    fn speed(&self) -> Result<u32, Error> {
        Ok(proxy!(self).speed()?)
    }
    fn s390_subchannels(&self) -> Result<Vec<String>, Error> {
        Ok(proxy!(self).s390_subchannels()?)
    }
    fn carrier(&self) -> Result<bool, Error> {
        Ok(proxy!(self).carrier()?)
    }
}