Struct async_tun::TunBuilder[][src]

pub struct TunBuilder<'a> { /* fields omitted */ }
Expand description

Represents a factory to build new instances of Tun.

Implementations

Creates a new instance of TunBuilder.

Sets the name of device (max length: 16 characters), if it is empty, then device name is set by kernel. Default value is empty.

If is_tap is true, a TAP device is allocated, otherwise, a TUN device is created. Default value is false.

If packet_info is false, then IFF_NO_PI flag is set. Default value is true.

Sets the MTU of device.

Sets the owner of device.

Sets the group of device.

Sets IPv4 address of device.

Sets IPv4 destination address of device.

Sets IPv4 broadcast address of device.

Sets IPv4 netmask address of device.

Sets Ethernet MAC address of device (for tap mode).

Makes the device persistent.

Sets up the device.

Builds a new instance of Tun.

Builds multiple instances of Tun with IFF_MULTI_QUEUE flag.

Trait Implementations

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.