hightower_client/transport.rs
1use hightower_wireguard::connection::Connection;
2use std::sync::Arc;
3
4/// Wrapper around hightower-wireguard transport connection.
5/// Provides access to the underlying transport for communication.
6#[derive(Clone)]
7pub struct TransportServer {
8 connection: Arc<Connection>,
9}
10
11impl TransportServer {
12 pub(crate) fn new(connection: Connection) -> Self {
13 Self { connection: Arc::new(connection) }
14 }
15
16 /// Get a reference to the underlying transport connection
17 ///
18 /// Use this to access the full hightower-wireguard Connection API
19 /// for sending and receiving data.
20 pub fn connection(&self) -> &Connection {
21 &self.connection
22 }
23}