aboutsummaryrefslogtreecommitdiffstats
path: root/src/wireguard/endpoint.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/wireguard/endpoint.rs')
-rw-r--r--src/wireguard/endpoint.rs29
1 files changed, 0 insertions, 29 deletions
diff --git a/src/wireguard/endpoint.rs b/src/wireguard/endpoint.rs
deleted file mode 100644
index f6a560b..0000000
--- a/src/wireguard/endpoint.rs
+++ /dev/null
@@ -1,29 +0,0 @@
-use spin::{Mutex, MutexGuard};
-use std::sync::Arc;
-
-use super::super::platform::Endpoint;
-
-#[derive(Clone)]
-struct EndpointStore<E: Endpoint> {
- endpoint: Arc<Mutex<Option<E>>>,
-}
-
-impl<E: Endpoint> EndpointStore<E> {
- pub fn new() -> EndpointStore<E> {
- EndpointStore {
- endpoint: Arc::new(Mutex::new(None)),
- }
- }
-
- pub fn set(&self, endpoint: E) {
- *self.endpoint.lock() = Some(endpoint);
- }
-
- pub fn get(&self) -> MutexGuard<Option<E>> {
- self.endpoint.lock()
- }
-
- pub fn clear_src(&self) {
- (*self.endpoint.lock()).as_mut().map(|e| e.clear_src());
- }
-}