pub struct Interface { /* private fields */ }Expand description
A handle to a WireGuard interface
Cloning returns a new handle to the same interface.
Implementations§
Source§impl Interface
impl Interface
Sourcepub fn close(&self)
pub fn close(&self)
Request that the interface be closed
All sockets created by the interface will be closed, and any attempt to send or receive data using them will result in an error. Once all remaining queued packets have been sent, the interface will enter the closed state.
Sourcepub fn closed(&self) -> Closed<'_> ⓘ
pub fn closed(&self) -> Closed<'_> ⓘ
Returns a future that resolves once the interface is in the closed state
See close for more information.
Sourcepub fn is_closed(&self) -> bool
pub fn is_closed(&self) -> bool
Whether the interface is in the closed state
See close for more information.
Sourcepub fn new_with(config: Config, options: Options) -> Result<Self, Error>
pub fn new_with(config: Config, options: Options) -> Result<Self, Error>
Create a new interface with advanced options
Trait Implementations§
Source§impl<'a> ToInterface for &'a Interface
impl<'a> ToInterface for &'a Interface
Source§impl<'a> ToInterface for &'a mut Interface
impl<'a> ToInterface for &'a mut Interface
Source§impl ToInterface for Interface
impl ToInterface for Interface
Auto Trait Implementations§
impl Freeze for Interface
impl RefUnwindSafe for Interface
impl Send for Interface
impl Sync for Interface
impl Unpin for Interface
impl UnwindSafe for Interface
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more