pub struct Configuration { /* private fields */ }
Expand description
Configuration builder for a TUN interface.
Implementations§
Source§impl Configuration
impl Configuration
Sourcepub fn platform_config<F>(&mut self, f: F) -> &mut Selfwhere
F: FnOnce(&mut PlatformConfig),
pub fn platform_config<F>(&mut self, f: F) -> &mut Selfwhere
F: FnOnce(&mut PlatformConfig),
Access the platform-dependent configuration.
Sourcepub fn name<S: AsRef<str>>(&mut self, tun_name: S) -> &mut Self
👎Deprecated since 0.7.0: Since the API name
may have an easy name conflict when IDE prompts, it is replaced by tun_name
for better coding experience
pub fn name<S: AsRef<str>>(&mut self, tun_name: S) -> &mut Self
name
may have an easy name conflict when IDE prompts, it is replaced by tun_name
for better coding experienceFunctionally equivalent to tun_name
Sourcepub fn tun_name<S: AsRef<str>>(&mut self, tun_name: S) -> &mut Self
pub fn tun_name<S: AsRef<str>>(&mut self, tun_name: S) -> &mut Self
Set the tun name.
[Note: on macOS, the tun name must be the form utunx
where x
is a number, such as utun3
. – end note]
Sourcepub fn destination<A: ToAddress>(&mut self, value: A) -> &mut Self
pub fn destination<A: ToAddress>(&mut self, value: A) -> &mut Self
Set the destination address.
Sourcepub fn queues(&mut self, value: usize) -> &mut Self
👎Deprecated since 0.7.0: The queues will always be 1.
pub fn queues(&mut self, value: usize) -> &mut Self
Set the number of queues. Note: The queues must be 1, otherwise will failed.
pub fn raw_fd(&mut self, fd: i32) -> &mut Self
pub fn raw_handle(&mut self, handle: HANDLE) -> &mut Self
pub fn ring_capacity(&mut self, ring_capacity: u32) -> &mut Self
pub fn metric(&mut self, metric: u16) -> &mut Self
Trait Implementations§
Source§impl Clone for Configuration
impl Clone for Configuration
Source§fn clone(&self) -> Configuration
fn clone(&self) -> Configuration
Returns a copy 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 Configuration
impl Debug for Configuration
Source§impl Default for Configuration
impl Default for Configuration
Source§fn default() -> Configuration
fn default() -> Configuration
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for Configuration
impl RefUnwindSafe for Configuration
impl Send for Configuration
impl Sync for Configuration
impl Unpin for Configuration
impl UnwindSafe for Configuration
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