[][src]Struct macvtap::Iface

pub struct Iface { /* fields omitted */ }

Implementations

impl Iface[src]

pub fn new(ifname: &str, mode: Mode, mtu: u32) -> Result<Self>[src]

Creates a new Iface.

Examples

modprobe macvtap
 
ip link add link ens192 name tap0 type macvtap mode bridge
 
use macvtap::{Iface, Mode};
use std::{io::{Read, Write, Result}, vec};
 
// sync read/write
let mut iface = Iface::new("tap0", Mode::MacvTap, 1500)?;
let mut buf = vec![0;1504];
buf.read(&mut buf);

// async read/write
use smol::{Async};
  
let async_iface = Async::new(iface)?;
async_iface.read(&mut buf).await;

pub fn close(&mut self) -> i32[src]

Trait Implementations

impl AsRawFd for Iface[src]

impl Debug for Iface[src]

impl Drop for Iface[src]

impl IntoRawFd for Iface[src]

impl Read for &Iface[src]

impl Read for Iface[src]

impl Write for &Iface[src]

impl Write for Iface[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.