pub struct VpnClient { /* private fields */ }Expand description
VPN client that manages the connection lifecycle
Implementations§
Source§impl VpnClient
impl VpnClient
Sourcepub fn new(config: OvpnConfig) -> Self
pub fn new(config: OvpnConfig) -> Self
Create a new VPN client from parsed .ovpn config
Sourcepub async fn connect_with_info(
&self,
event_tx: Option<UnboundedSender<ConnectionEvent>>,
) -> Result<()>
pub async fn connect_with_info( &self, event_tx: Option<UnboundedSender<ConnectionEvent>>, ) -> Result<()>
Connect to the VPN server, sending lifecycle events through the optional channel.
This is used by the NetworkManager plugin to receive push reply data (IP, routes, DNS) before the data plane starts, so it can report the configuration back to NetworkManager.
Auto Trait Implementations§
impl Freeze for VpnClient
impl RefUnwindSafe for VpnClient
impl Send for VpnClient
impl Sync for VpnClient
impl Unpin for VpnClient
impl UnsafeUnpin for VpnClient
impl UnwindSafe for VpnClient
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