pub struct TunDevice { /* private fields */ }Implementations§
Source§impl TunDevice
impl TunDevice
Sourcepub async fn new(name: &str) -> Result<Self>
pub async fn new(name: &str) -> Result<Self>
Create and bring up a new TUN device
§Name format
The name field can be any string. If %d is present in the string,
it will be replaced with a unique number.
Sourcepub async fn add_address(
&mut self,
ip_address: IpAddr,
prefix_len: u8,
) -> Result<()>
pub async fn add_address( &mut self, ip_address: IpAddr, prefix_len: u8, ) -> Result<()>
Add an IP address to this device
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TunDevice
impl !RefUnwindSafe for TunDevice
impl Send for TunDevice
impl Sync for TunDevice
impl Unpin for TunDevice
impl !UnwindSafe for TunDevice
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