Struct Device

Source
pub struct Device(/* private fields */);

Implementations§

Source§

impl Device

Source

pub fn name(&self) -> Result<String>

Source

pub fn set_name<S: Into<CString>>(&mut self, name: S) -> Result<()>

Source

pub fn public_key(&self) -> Option<PublicKey>

Source

pub fn secret_key(&self) -> Option<SecretKey>

Source

pub fn set_secret_key(&mut self, secret_key: Option<SecretKey>)

Source

pub fn listen_port(&self) -> Option<u16>

Source

pub fn set_listen_port(&mut self, listen_port: Option<u16>)

Source

pub fn fwmark(&self) -> Option<u32>

Source

pub fn set_fwmark(&mut self, fwmark: Option<u32>)

Source

pub fn ifindex(&self) -> u32

Source

pub fn set_ifindex(&mut self, ifindex: u32)

Source

pub fn devices() -> Result<Vec<Device>>

Source

pub fn get<S: Into<Vec<u8>>>(device_name: S) -> Result<Device>

Source

pub fn apply(&self) -> Result<()>

Source

pub fn add<S: Into<Vec<u8>>>(device_name: S) -> Result<()>

Source

pub fn del(&self) -> Result<()>

Source

pub fn get_peer<'a>(&'a self, peer: &PublicKey) -> Option<Peer<'a>>

Source

pub fn peers<'a>(&'a self) -> Vec<Peer<'a>>

Source

pub fn next_handshake(&self) -> Option<Duration>

Trait Implementations§

Source§

impl Debug for Device

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Drop for Device

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Send for Device

Source§

impl Sync for Device

Auto Trait Implementations§

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