pub struct LinkMacVtap;Expand description
Represent MAC VTAP interface. Example code on creating a MAC VTAP interface
use rtnetlink::{new_connection, packet_route::link::MacVtapMode,
LinkMacVtap};
#[tokio::main]
async fn main() -> Result<(), String> {
let (connection, handle, _) = new_connection().unwrap();
tokio::spawn(connection);
handle
.link()
.add(
LinkMacVtap::new("macvtap100", 10, MacVtapMode::Bridge)
.up()
.build(),
)
.execute()
.await
.map_err(|e| format!("{e}"))
}Please check LinkMessageBuilder::
Implementations§
Source§impl LinkMacVtap
impl LinkMacVtap
Sourcepub fn new(
name: &str,
base_iface_index: u32,
mode: MacVtapMode,
) -> LinkMessageBuilder<Self>
pub fn new( name: &str, base_iface_index: u32, mode: MacVtapMode, ) -> LinkMessageBuilder<Self>
Wrapper of LinkMessageBuilder::<LinkMacVtap>::new().link().mode()
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LinkMacVtap
impl RefUnwindSafe for LinkMacVtap
impl Send for LinkMacVtap
impl Sync for LinkMacVtap
impl Unpin for LinkMacVtap
impl UnwindSafe for LinkMacVtap
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