Struct wireguard_uapi::WgSocket [−][src]
Implementations
impl WgSocket
[src]
pub fn connect() -> Result<Self, ConnectError>
[src]
pub fn get_device(
&mut self,
interface: DeviceInterface<'_>
) -> Result<Device, GetDeviceError>
[src]
&mut self,
interface: DeviceInterface<'_>
) -> Result<Device, GetDeviceError>
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
impl RefUnwindSafe for WgSocket
impl Send for WgSocket
impl Sync for WgSocket
impl Unpin for WgSocket
impl UnwindSafe for WgSocket
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,