ethtool/link_mode/
handle.rs

1// SPDX-License-Identifier: MIT
2
3use crate::{EthtoolHandle, EthtoolLinkModeGetRequest};
4
5pub struct EthtoolLinkModeHandle(EthtoolHandle);
6
7impl EthtoolLinkModeHandle {
8    pub fn new(handle: EthtoolHandle) -> Self {
9        EthtoolLinkModeHandle(handle)
10    }
11
12    /// Retrieve the ethtool link_modes(duplex, link speed and etc) of a
13    /// interface
14    pub fn get(
15        &mut self,
16        iface_name: Option<&str>,
17    ) -> EthtoolLinkModeGetRequest {
18        EthtoolLinkModeGetRequest::new(self.0.clone(), iface_name)
19    }
20}