Skip to main content

Wgpeer

Enum Wgpeer 

Source
pub enum Wgpeer<'a> {
    PublicKey(&'a [u8]),
    PresharedKey(&'a [u8]),
    Flags(u32),
    Endpoint(SocketAddr),
    PersistentKeepaliveInterval(u16),
    LastHandshakeTime(KernelTimespec),
    RxBytes(u64),
    TxBytes(u64),
    Allowedips(IterableArrayWgallowedip<'a>),
    ProtocolVersion(u32),
}
Available on crate feature wireguard only.

Variants§

§

PublicKey(&'a [u8])

§

PresharedKey(&'a [u8])

Set as all zeros to remove.

§

Flags(u32)

0 and/or WGPEER_F_REMOVE_ME if the specified peer should not exist at the end of the operation, rather than added/updated and/or WGPEER_F_REPLACE_ALLOWEDIPS if all current allowed IPs of this peer should be removed prior to adding the list below and/or WGPEER_F_UPDATE_ONLY if the peer should only be set if it already exists.

Associated type: WgpeerFlags (enum)

§

Endpoint(SocketAddr)

struct sockaddr_in or struct sockaddr_in6

§

PersistentKeepaliveInterval(u16)

Set as 0 to disable.

§

LastHandshakeTime(KernelTimespec)

§

RxBytes(u64)

§

TxBytes(u64)

§

Allowedips(IterableArrayWgallowedip<'a>)

The index/type parameter is unused on SET_DEVICE operations and is zero on GET_DEVICE operations.

§

ProtocolVersion(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> Wgpeer<'a>

Source

pub fn new_array(buf: &[u8]) -> IterableArrayWgpeer<'_>

Source§

impl Wgpeer<'_>

Source

pub fn new<'a>(buf: &'a [u8]) -> IterableWgpeer<'a>

Trait Implementations§

Source§

impl<'a> Clone for Wgpeer<'a>

Source§

fn clone(&self) -> Wgpeer<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Wgpeer<'a>

§

impl<'a> RefUnwindSafe for Wgpeer<'a>

§

impl<'a> Send for Wgpeer<'a>

§

impl<'a> Sync for Wgpeer<'a>

§

impl<'a> Unpin for Wgpeer<'a>

§

impl<'a> UnsafeUnpin for Wgpeer<'a>

§

impl<'a> UnwindSafe for Wgpeer<'a>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.