Struct tun_rs::Configuration
source · 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
pub fn 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 address_with_prefix<A: IntoAddress>(
&mut self,
value: A,
prefix: u8,
) -> &mut Self
pub fn address_with_prefix<A: IntoAddress>( &mut self, value: A, prefix: u8, ) -> &mut Self
Set the address.
sourcepub fn destination<A: IntoAddress>(&mut self, value: A) -> &mut Self
pub fn destination<A: IntoAddress>(&mut self, value: A) -> &mut Self
Set the destination address.
sourcepub fn broadcast<A: IntoAddress>(&mut self, value: A) -> &mut Self
pub fn broadcast<A: IntoAddress>(&mut self, value: A) -> &mut Self
Set the broadcast address.
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)