pub struct Device {
    pub private_key: Option<[u8; 32]>,
    pub listen_port: Option<u16>,
    pub fwmark: Option<u32>,
    pub replace_peers: Option<bool>,
    pub peers: Vec<Peer>,
}
Expand description

Documentation of each field comes from: https://www.wireguard.com/xplatform/#configuration-protocol

Fields§

§private_key: Option<[u8; 32]>

The value for this key should be a lowercase hex-encoded private key of the interface. The value may be an all zero string in the case of a set operation, in which case it indicates that the private key should be removed.

§listen_port: Option<u16>

The value for this is a decimal-string integer corresponding to the listening port of the interface.

§fwmark: Option<u32>

The value for this is a decimal-string integer corresponding to the fwmark of the interface. The value may 0 in the case of a set operation, in which case it indicates that the fwmark should be removed.

§replace_peers: Option<bool>

This key/value combo is only valid in a set operation, in which case it indicates that the subsequent peers (perhaps an empty list) should replace any existing peers, rather than append to the existing peer list.

§peers: Vec<Peer>

Trait Implementations§

source§

impl Debug for Device

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Device

source§

fn default() -> Device

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

impl Display for Device

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<Device> for Device

source§

fn eq(&self, other: &Device) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for Device

source§

impl StructuralEq for Device

source§

impl StructuralPartialEq for Device

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.