pub struct LinkIp6Tnl { /* private fields */ }Expand description
Represent IP6TNL interface. Example code on creating a IP6TNL interface
use std::net::Ipv6Addr;
use rtnetlink::{new_connection, LinkIp6Tnl};
#[tokio::main]
async fn main() -> Result<(), String> {
let (connection, handle, _) = new_connection().unwrap();
tokio::spawn(connection);
handle
.link()
.add(
LinkIp6Tnl::new("ip6tnl0")
.local(Ipv6Addr::new(0x2001, 0xdb8, 0, 0, 0, 0, 0, 1))
.remote(Ipv6Addr::new(0x2001, 0xdb8, 0, 0, 0, 0, 0, 2))
.build(),
)
.execute()
.await
.map_err(|e| format!("{e}"))
}Please check LinkMessageBuilder::
Implementations§
Source§impl LinkIp6Tnl
impl LinkIp6Tnl
Sourcepub fn new(name: &str) -> LinkMessageBuilder<Self>
pub fn new(name: &str) -> LinkMessageBuilder<Self>
Equal to LinkMessageBuilder::<LinkIp6Tnl>::new()
Trait Implementations§
Source§impl Debug for LinkIp6Tnl
impl Debug for LinkIp6Tnl
Auto Trait Implementations§
impl Freeze for LinkIp6Tnl
impl RefUnwindSafe for LinkIp6Tnl
impl Send for LinkIp6Tnl
impl Sync for LinkIp6Tnl
impl Unpin for LinkIp6Tnl
impl UnsafeUnpin for LinkIp6Tnl
impl UnwindSafe for LinkIp6Tnl
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