pub struct LinkNetkit;Expand description
Represent netkit virtual interface. Netkit devices are used for container networking and BPF programs.
Example code on creating a netkit pair:
use rtnetlink::{new_connection, LinkNetkit, packet_route::link::NetkitMode};
#[tokio::main]
async fn main() -> Result<(), String> {
let (connection, handle, _) = new_connection().unwrap();
tokio::spawn(connection);
handle
.link()
.add(LinkNetkit::new("netkit0", "netkit0-peer", NetkitMode::L3).build())
.execute()
.await
.map_err(|e| format!("{e}"))
}Please check LinkMessageBuilder::
Implementations§
Source§impl LinkNetkit
impl LinkNetkit
Sourcepub fn new(name: &str, peer: &str, mode: NetkitMode) -> LinkMessageBuilder<Self>
pub fn new(name: &str, peer: &str, mode: NetkitMode) -> LinkMessageBuilder<Self>
Equal to LinkMessageBuilder::<LinkNetkit>::new(name, peer, mode)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LinkNetkit
impl RefUnwindSafe for LinkNetkit
impl Send for LinkNetkit
impl Sync for LinkNetkit
impl Unpin for LinkNetkit
impl UnwindSafe for LinkNetkit
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