Struct wireguard_control::Device[][src]

pub struct Device {
    pub name: InterfaceName,
    pub public_key: Option<Key>,
    pub private_key: Option<Key>,
    pub fwmark: Option<u32>,
    pub listen_port: Option<u16>,
    pub peers: Vec<PeerInfo>,
    pub linked_name: Option<String>,
    pub backend: Backend,
    // some fields omitted
}
Expand description

Represents all available information about a WireGuard device (interface).

This struct contains the current configuration of the device and the current configuration and state of all of its peers. The peer statistics are retrieved once at construction time, and need to be updated manually by calling get_by_name.

Fields

name: InterfaceName

The interface name of this device

public_key: Option<Key>

The public encryption key of this interface (if present)

private_key: Option<Key>

The private encryption key of this interface (if present)

fwmark: Option<u32>

The fwmark of this interface

listen_port: Option<u16>

The port to listen for incoming connections on

peers: Vec<PeerInfo>

The list of all registered peers and their information

linked_name: Option<String>

The associated “real name” of the interface (ex. “utun8” on macOS).

backend: Backend

The backend the device exists on (userspace or kernel).

Implementations

Enumerates all WireGuard interfaces currently present in the system, both with kernel and userspace backends.

You can use get_by_name to retrieve more detailed information on each interface.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.