Struct Peer

Source
pub struct Peer {
    pub public_key: Key,
    pub preshared_key: Option<Key>,
    pub endpoint: SocketAddr,
    pub persistent_keepalive_interval: Option<Duration>,
    pub last_handshake_time: Option<SystemTime>,
    pub rx_bytes: i64,
    pub tx_bytes: i64,
    pub allowed_ips: Vec<IpNet>,
    pub protocol_version: Option<u16>,
}
Expand description

Peer is a WireGuard peer to a Device.

Fields§

§public_key: Key

public_key is the public key of a peer, computed from its private key. It is always present in a Peer.

§preshared_key: Option<Key>

preshared_key is an optional preshared key which may be used as an additional layer of security for peer communications.

§endpoint: SocketAddr

endpoint is the most recent source address used for communication by this Peer.

§persistent_keepalive_interval: Option<Duration>

persistent_keepalive_interval specifies how often an “empty” packet is sent to a peer to keep a connection alive.

§last_handshake_time: Option<SystemTime>

last_handshake_time indicates the most recent time a handshake was performed with this peer.

§rx_bytes: i64

rx_bytes indicates the number of bytes received from this peer.

§tx_bytes: i64

tx_bytes indicates the number of bytes transmitted to this peer.

§allowed_ips: Vec<IpNet>

allowed_ips specifies which IPv4 and IPv6 addresses this peer is allowed to communicate on.

§protocol_version: Option<u16>

protocol_version specifies which version of the WireGuard protocol is used for this Peer.

Auto Trait Implementations§

§

impl Freeze for Peer

§

impl RefUnwindSafe for Peer

§

impl Send for Peer

§

impl Sync for Peer

§

impl Unpin for Peer

§

impl UnwindSafe for Peer

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V