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