Struct wireguard_uapi::linux::set::Peer
source · pub struct Peer<'a> {
pub public_key: &'a [u8; 32],
pub flags: Vec<WgPeerF>,
pub preshared_key: Option<&'a [u8; 32]>,
pub endpoint: Option<&'a SocketAddr>,
pub persistent_keepalive_interval: Option<u16>,
pub allowed_ips: Vec<AllowedIp<'a>>,
pub protocol_version: Option<u32>,
}
Fields§
§public_key: &'a [u8; 32]
§flags: Vec<WgPeerF>
all zeros to remove
endpoint: Option<&'a SocketAddr>
§persistent_keepalive_interval: Option<u16>
0 to disable
allowed_ips: Vec<AllowedIp<'a>>
§protocol_version: Option<u32>
should not be set or used at all by most users of this API, as the most recent protocol will be used when this is unset. Otherwise, must be set to 1.
Implementations§
source§impl<'a> Peer<'a>
impl<'a> Peer<'a>
pub fn from_public_key(public_key: &'a [u8; 32]) -> Self
pub fn flags(self, flags: Vec<WgPeerF>) -> Self
pub fn endpoint(self, endpoint: &'a SocketAddr) -> Self
pub fn persistent_keepalive_interval( self, persistent_keepalive_interval: u16 ) -> Self
pub fn allowed_ips(self, allowed_ips: Vec<AllowedIp<'a>>) -> Self
pub fn protocol_version(self, protocol_version: u32) -> Self
Trait Implementations§
Auto Trait Implementations§
impl<'a> RefUnwindSafe for Peer<'a>
impl<'a> Send for Peer<'a>
impl<'a> Sync for Peer<'a>
impl<'a> Unpin for Peer<'a>
impl<'a> UnwindSafe for Peer<'a>
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