pub struct PlatformConfig { /* private fields */ }
Expand description
Linux-only interface configuration.
Implementations§
Source§impl PlatformConfig
impl PlatformConfig
Sourcepub fn packet_information(&mut self, value: bool) -> &mut Self
👎Deprecated since 1.0.0: No effect applies to the packets delivered from/to tun2 since the packets always contain no header on all platforms.
pub fn packet_information(&mut self, value: bool) -> &mut Self
Enable or disable packet information, the first 4 bytes of each packet delivered from/to Linux underlying API is a header with flags and protocol type when enabled.
[Note: This configuration just applies to the Linux underlying API and is a no-op on tun2(i.e. the packets delivered from/to tun2 always contain no packet information) – end note].
Sourcepub fn ensure_root_privileges(&mut self, value: bool) -> &mut Self
pub fn ensure_root_privileges(&mut self, value: bool) -> &mut Self
Indicated whether tun2 running in root privilege, since some operations need it such as assigning IP/netmask/destination etc.
Trait Implementations§
Source§impl Clone for PlatformConfig
impl Clone for PlatformConfig
Source§fn clone(&self) -> PlatformConfig
fn clone(&self) -> PlatformConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for PlatformConfig
impl Debug for PlatformConfig
Source§impl Default for PlatformConfig
packet_information
is default to be false
and ensure_root_privileges
is default to be true
.
impl Default for PlatformConfig
packet_information
is default to be false
and ensure_root_privileges
is default to be true
.
impl Copy for PlatformConfig
Auto Trait Implementations§
impl Freeze for PlatformConfig
impl RefUnwindSafe for PlatformConfig
impl Send for PlatformConfig
impl Sync for PlatformConfig
impl Unpin for PlatformConfig
impl UnwindSafe for PlatformConfig
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