pub struct LinkUnspec;Expand description
Generic interface without interface type Could be used to match interface by interface name or index. Example on attaching a interface to controller
use rtnetlink::{new_connection, LinkUnspec};
#[tokio::main]
async fn main() -> Result<(), String> {
let (connection, handle, _) = new_connection().unwrap();
tokio::spawn(connection);
let controller_index = 63u32;
handle
.link()
.set(
LinkUnspec::new_with_name("my-nic")
.controller(controller_index)
.build(),
)
.execute()
.await
.map_err(|e| format!("{e}"))
}Implementations§
Source§impl LinkUnspec
impl LinkUnspec
Sourcepub fn new_with_index(index: u32) -> LinkMessageBuilder<Self>
pub fn new_with_index(index: u32) -> LinkMessageBuilder<Self>
Equal to LinkMessageBuilder::<LinkUnspec>::default().index()
Sourcepub fn new_with_name(name: &str) -> LinkMessageBuilder<Self>
pub fn new_with_name(name: &str) -> LinkMessageBuilder<Self>
Equal to LinkMessageBuilder::<LinkUnspec>::default().name()
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LinkUnspec
impl RefUnwindSafe for LinkUnspec
impl Send for LinkUnspec
impl Sync for LinkUnspec
impl Unpin for LinkUnspec
impl UnwindSafe for LinkUnspec
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