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>§preshared_key: Option<&'a [u8; 32]>

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>

source

pub fn from_public_key(public_key: &'a [u8; 32]) -> Self

source

pub fn flags(self, flags: Vec<WgPeerF>) -> Self

source

pub fn preshared_key(self, preshared_key: &'a [u8; 32]) -> Self

source

pub fn endpoint(self, endpoint: &'a SocketAddr) -> Self

source

pub fn persistent_keepalive_interval( self, persistent_keepalive_interval: u16 ) -> Self

source

pub fn allowed_ips(self, allowed_ips: Vec<AllowedIp<'a>>) -> Self

source

pub fn protocol_version(self, protocol_version: u32) -> Self

Trait Implementations§

source§

impl<'a> Debug for Peer<'a>

source§

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

Formats the value using the given formatter. Read more

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> 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, 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.