ethtool/feature/
handle.rs

1// SPDX-License-Identifier: MIT
2
3use crate::{EthtoolFeatureGetRequest, EthtoolHandle};
4
5pub struct EthtoolFeatureHandle(EthtoolHandle);
6
7impl EthtoolFeatureHandle {
8    pub fn new(handle: EthtoolHandle) -> Self {
9        EthtoolFeatureHandle(handle)
10    }
11
12    /// Retrieve the ethtool features of a interface (equivalent to `ethtool -k
13    /// eth1`)
14    pub fn get(
15        &mut self,
16        iface_name: Option<&str>,
17    ) -> EthtoolFeatureGetRequest {
18        EthtoolFeatureGetRequest::new(self.0.clone(), iface_name)
19    }
20}