Struct wireguard_uapi::WgSocket[][src]

pub struct WgSocket { /* fields omitted */ }

Implementations

impl WgSocket[src]

pub fn connect() -> Result<Self, ConnectError>[src]

pub fn get_device(
    &mut self,
    interface: DeviceInterface<'_>
) -> Result<Device, GetDeviceError>
[src]

pub fn set_device(&mut self, device: Device<'_>) -> Result<(), SetDeviceError>[src]

This assumes that the device interface has already been created. Otherwise an error will be returned. You can create a new device interface with RouteSocket::add_device.

The peers in this device won’t be reachable at their allowed IPs until they’re added to the newly created device interface through a Netlink Route message. This library doesn’t have built-in way to do that right now. Here’s how it would be done with the ip command:

 sudo ip -4 route add 127.3.1.1/32 dev wgtest0

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