Struct Sys

Source
pub struct Sys {
    pub WireGuardCreateAdapter: unsafe extern "C" fn(arg1: *const c_ushort, arg2: *const c_ushort, arg3: *const _GUID) -> *mut _WIREGUARD_ADAPTER,
    pub WireGuardOpenAdapter: unsafe extern "C" fn(arg1: *const c_ushort) -> *mut _WIREGUARD_ADAPTER,
    pub WireGuardCloseAdapter: unsafe extern "C" fn(arg1: *mut _WIREGUARD_ADAPTER),
    pub WireGuardGetAdapterLUID: unsafe extern "C" fn(arg1: *mut _WIREGUARD_ADAPTER, arg2: *mut _NET_LUID_LH),
    pub WireGuardGetRunningDriverVersion: unsafe extern "C" fn() -> c_ulong,
    pub WireGuardDeleteDriver: unsafe extern "C" fn() -> c_int,
    pub WireGuardSetLogger: unsafe extern "C" fn(arg1: Option<unsafe extern "C" fn(Level: c_int, Timestamp: c_ulonglong, Message: *const c_ushort)>),
    pub WireGuardSetAdapterLogging: unsafe extern "C" fn(arg1: *mut _WIREGUARD_ADAPTER, arg2: c_int) -> c_int,
    pub WireGuardGetAdapterState: unsafe extern "C" fn(arg1: *mut _WIREGUARD_ADAPTER, arg2: *mut c_int) -> c_int,
    pub WireGuardSetAdapterState: unsafe extern "C" fn(arg1: *mut _WIREGUARD_ADAPTER, arg2: c_int) -> c_int,
    pub WireGuardGetConfiguration: unsafe extern "C" fn(arg1: *mut _WIREGUARD_ADAPTER, arg2: *mut _WIREGUARD_INTERFACE, arg3: *mut c_ulong) -> c_int,
    pub WireGuardSetConfiguration: unsafe extern "C" fn(arg1: *mut _WIREGUARD_ADAPTER, arg2: *const _WIREGUARD_INTERFACE, arg3: c_ulong) -> c_int,
    /* private fields */
}

Fields§

§WireGuardCreateAdapter: unsafe extern "C" fn(arg1: *const c_ushort, arg2: *const c_ushort, arg3: *const _GUID) -> *mut _WIREGUARD_ADAPTER§WireGuardOpenAdapter: unsafe extern "C" fn(arg1: *const c_ushort) -> *mut _WIREGUARD_ADAPTER§WireGuardCloseAdapter: unsafe extern "C" fn(arg1: *mut _WIREGUARD_ADAPTER)§WireGuardGetAdapterLUID: unsafe extern "C" fn(arg1: *mut _WIREGUARD_ADAPTER, arg2: *mut _NET_LUID_LH)§WireGuardGetRunningDriverVersion: unsafe extern "C" fn() -> c_ulong§WireGuardDeleteDriver: unsafe extern "C" fn() -> c_int§WireGuardSetLogger: unsafe extern "C" fn(arg1: Option<unsafe extern "C" fn(Level: c_int, Timestamp: c_ulonglong, Message: *const c_ushort)>)§WireGuardSetAdapterLogging: unsafe extern "C" fn(arg1: *mut _WIREGUARD_ADAPTER, arg2: c_int) -> c_int§WireGuardGetAdapterState: unsafe extern "C" fn(arg1: *mut _WIREGUARD_ADAPTER, arg2: *mut c_int) -> c_int§WireGuardSetAdapterState: unsafe extern "C" fn(arg1: *mut _WIREGUARD_ADAPTER, arg2: c_int) -> c_int§WireGuardGetConfiguration: unsafe extern "C" fn(arg1: *mut _WIREGUARD_ADAPTER, arg2: *mut _WIREGUARD_INTERFACE, arg3: *mut c_ulong) -> c_int§WireGuardSetConfiguration: unsafe extern "C" fn(arg1: *mut _WIREGUARD_ADAPTER, arg2: *const _WIREGUARD_INTERFACE, arg3: c_ulong) -> c_int

Implementations§

Source§

impl wireguard

Source

pub unsafe fn new<P>(path: P) -> Result<Self, Error>
where P: AsRef<OsStr>,

Source

pub unsafe fn from_library<L>(library: L) -> Result<Self, Error>
where L: Into<Library>,

Source

pub unsafe fn WireGuardCreateAdapter( &self, arg1: *const c_ushort, arg2: *const c_ushort, arg3: *const _GUID, ) -> *mut _WIREGUARD_ADAPTER

Source

pub unsafe fn WireGuardOpenAdapter( &self, arg1: *const c_ushort, ) -> *mut _WIREGUARD_ADAPTER

Source

pub unsafe fn WireGuardCloseAdapter(&self, arg1: *mut _WIREGUARD_ADAPTER)

Source

pub unsafe fn WireGuardGetAdapterLUID( &self, arg1: *mut _WIREGUARD_ADAPTER, arg2: *mut _NET_LUID_LH, )

Source

pub unsafe fn WireGuardGetRunningDriverVersion(&self) -> c_ulong

Source

pub unsafe fn WireGuardDeleteDriver(&self) -> c_int

Source

pub unsafe fn WireGuardSetLogger( &self, arg1: Option<unsafe extern "C" fn(Level: c_int, Timestamp: c_ulonglong, Message: *const c_ushort)>, )

Source

pub unsafe fn WireGuardSetAdapterLogging( &self, arg1: *mut _WIREGUARD_ADAPTER, arg2: c_int, ) -> c_int

Source

pub unsafe fn WireGuardGetAdapterState( &self, arg1: *mut _WIREGUARD_ADAPTER, arg2: *mut c_int, ) -> c_int

Source

pub unsafe fn WireGuardSetAdapterState( &self, arg1: *mut _WIREGUARD_ADAPTER, arg2: c_int, ) -> c_int

Source

pub unsafe fn WireGuardGetConfiguration( &self, arg1: *mut _WIREGUARD_ADAPTER, arg2: *mut _WIREGUARD_INTERFACE, arg3: *mut c_ulong, ) -> c_int

Source

pub unsafe fn WireGuardSetConfiguration( &self, arg1: *mut _WIREGUARD_ADAPTER, arg2: *const _WIREGUARD_INTERFACE, arg3: c_ulong, ) -> c_int

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.