pub struct TunTapDevice { /* private fields */ }
Expand description
A TUN/TAP device, wrapped in an async interface.
Implementations§
Source§impl TunTapDevice
impl TunTapDevice
Sourcepub fn new(name: &str) -> Result<TunTapDevice>
pub fn new(name: &str) -> Result<TunTapDevice>
Create a new TUN/TAP device.
Trait Implementations§
Source§impl Driver for TunTapDevice
impl Driver for TunTapDevice
Source§fn receive(
&mut self,
cx: &mut Context<'_>,
) -> Option<(Self::RxToken<'_>, Self::TxToken<'_>)>
fn receive( &mut self, cx: &mut Context<'_>, ) -> Option<(Self::RxToken<'_>, Self::TxToken<'_>)>
Construct a token pair consisting of one receive token and one transmit token. Read more
Source§fn transmit(&mut self, _cx: &mut Context<'_>) -> Option<Self::TxToken<'_>>
fn transmit(&mut self, _cx: &mut Context<'_>) -> Option<Self::TxToken<'_>>
Construct a transmit token. Read more
Source§fn capabilities(&self) -> Capabilities
fn capabilities(&self) -> Capabilities
Get a description of device capabilities.
Source§fn hardware_address(&self) -> HardwareAddress
fn hardware_address(&self) -> HardwareAddress
Get the device’s hardware address. Read more
Auto Trait Implementations§
impl Freeze for TunTapDevice
impl RefUnwindSafe for TunTapDevice
impl Send for TunTapDevice
impl Sync for TunTapDevice
impl Unpin for TunTapDevice
impl UnwindSafe for TunTapDevice
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