Struct defguard_wireguard_rs::host::Peer
source · pub struct Peer {
pub public_key: Key,
pub preshared_key: Option<Key>,
pub protocol_version: Option<u32>,
pub endpoint: Option<SocketAddr>,
pub last_handshake: Option<SystemTime>,
pub tx_bytes: u64,
pub rx_bytes: u64,
pub persistent_keepalive_interval: Option<u16>,
pub allowed_ips: Vec<IpAddrMask>,
}
Expand description
WireGuard peer representation.
Fields§
§public_key: Key
§protocol_version: Option<u32>
§endpoint: Option<SocketAddr>
§last_handshake: Option<SystemTime>
§tx_bytes: u64
§rx_bytes: u64
§persistent_keepalive_interval: Option<u16>
§allowed_ips: Vec<IpAddrMask>
Implementations§
source§impl Peer
impl Peer
pub fn set_allowed_ips(&mut self, allowed_ips: Vec<IpAddrMask>)
pub fn as_uapi_update(&self) -> String
pub fn as_uapi_remove(&self) -> String
source§impl Peer
impl Peer
pub fn from_nlas(nlas: &[WgPeerAttrs]) -> Self
pub fn as_nlas(&self, ifname: &str) -> Vec<WgDeviceAttrs>
pub fn as_nlas_peer(&self) -> WgPeer
Trait Implementations§
source§impl<'de> Deserialize<'de> for Peer
impl<'de> Deserialize<'de> for Peer
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for Peer
impl PartialEq for Peer
impl StructuralPartialEq for Peer
Auto Trait Implementations§
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> 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