pub struct IpTool { /* private fields */ }Expand description
Only use it for a short amount of time, as it does not close it’s ioctl socket
Implementations§
Source§impl IpTool
impl IpTool
pub fn new() -> Result<Self>
pub fn set_up(&self, dev: &str, up: bool) -> Result<()>
pub fn get_up(&self, dev: &str) -> Result<bool>
pub fn set_mtu(&self, dev: &str, mtu: u32) -> Result<()>
pub fn get_mtu(&self, dev: &str) -> Result<u32>
pub fn get_index(&self, dev: &str) -> Result<c_int>
pub fn set_address( &self, dev: &str, address: &IpAddr, prefix_length: u32, ) -> Result<()>
pub fn get_address(&self, _dev: &str) -> Result<IpAddr>
pub fn set_mac(&self, dev: &str, mac: &str) -> Result<()>
pub fn set_mac_sa_data(&self, dev: &str, mac: [c_char; 14]) -> Result<()>
pub fn get_mac_sa_data(&self, dev: &str) -> Result<[c_char; 14]>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IpTool
impl RefUnwindSafe for IpTool
impl Send for IpTool
impl Sync for IpTool
impl Unpin for IpTool
impl UnwindSafe for IpTool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more