pub enum Mode {
Tun,
Tap,
}
Expand description
The mode in which open the virtual network adapter.
Variants§
Tun
TUN mode
The packets returned are on the IP layer (layer 3), prefixed with 4-byte header (2 bytes are flags, 2 bytes are the protocol inside, eg one of https://en.wikipedia.org/wiki/EtherType#Examples.
Tap
TAP mode
The packets are on the transport layer (layer 2), and start with ethernet frame header.
Trait Implementations§
source§impl Ord for Mode
impl Ord for Mode
source§impl PartialEq<Mode> for Mode
impl PartialEq<Mode> for Mode
source§impl PartialOrd<Mode> for Mode
impl PartialOrd<Mode> for Mode
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Mode
impl Eq for Mode
impl StructuralEq for Mode
impl StructuralPartialEq for Mode
Auto Trait Implementations§
impl RefUnwindSafe for Mode
impl Send for Mode
impl Sync for Mode
impl Unpin for Mode
impl UnwindSafe for Mode
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