pub struct LinkTun;Expand description
Represent TUN/TAP interface. Example code on creating a TUN interface
use rtnetlink::{new_connection, LinkTun};
#[tokio::main]
async fn main() -> Result<(), String> {
let (connection, handle, _) = new_connection().unwrap();
tokio::spawn(connection);
handle
.link()
.add(LinkTun::new("tun0").build())
.execute()
.await
.map_err(|e| format!("{e}"))
}Please check LinkMessageBuilder::
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LinkTun
impl RefUnwindSafe for LinkTun
impl Send for LinkTun
impl Sync for LinkTun
impl Unpin for LinkTun
impl UnsafeUnpin for LinkTun
impl UnwindSafe for LinkTun
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