Struct wireguard_uapi::get::PeerBuilder[][src]

pub struct PeerBuilder {
    pub public_key: Option<[u8; 32]>,
    pub allowed_ips: Option<Vec<AllowedIp>>,
    // some fields omitted
}

Builder for Peer.

Fields

public_key: Option<[u8; 32]>allowed_ips: Option<Vec<AllowedIp>>

Implementations

impl PeerBuilder[src]

pub fn public_key(&mut self, value: [u8; 32]) -> &mut Self[src]

pub fn preshared_key(&mut self, value: [u8; 32]) -> &mut Self[src]

pub fn endpoint(&mut self, value: Option<SocketAddr>) -> &mut Self[src]

pub fn persistent_keepalive_interval(&mut self, value: u16) -> &mut Self[src]

pub fn last_handshake_time(&mut self, value: Duration) -> &mut Self[src]

pub fn rx_bytes(&mut self, value: u64) -> &mut Self[src]

pub fn tx_bytes(&mut self, value: u64) -> &mut Self[src]

pub fn allowed_ips(&mut self, value: Vec<AllowedIp>) -> &mut Self[src]

pub fn protocol_version(&mut self, value: u32) -> &mut Self[src]

pub fn build(&self) -> Result<Peer, String>[src]

Builds a new Peer.

Errors

If a required field has not been initialized.

Trait Implementations

impl Clone for PeerBuilder[src]

impl Default for PeerBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.