aboutsummaryrefslogtreecommitdiffstats
path: root/src/platform/uapi.rs
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2019-11-15 15:32:36 +0100
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2019-11-15 15:32:36 +0100
commit05710c455f1c759cf9bc1a1eaa6307fe564f15cc (patch)
treec671d703d0db93a9bc8f27d0e2b02d0422120352 /src/platform/uapi.rs
parentInitial version of full UAPI parser (diff)
downloadwireguard-rs-05710c455f1c759cf9bc1a1eaa6307fe564f15cc.tar.xz
wireguard-rs-05710c455f1c759cf9bc1a1eaa6307fe564f15cc.zip
Update UAPI semantics for remove
Diffstat (limited to 'src/platform/uapi.rs')
-rw-r--r--src/platform/uapi.rs16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/platform/uapi.rs b/src/platform/uapi.rs
new file mode 100644
index 0000000..6922a9c
--- /dev/null
+++ b/src/platform/uapi.rs
@@ -0,0 +1,16 @@
+use std::error::Error;
+use std::io::{Read, Write};
+
+pub trait BindUAPI {
+ type Stream: Read + Write;
+ type Error: Error;
+
+ fn accept(&self) -> Result<Self::Stream, Self::Error>;
+}
+
+pub trait PlatformUAPI {
+ type Error: Error;
+ type Bind: BindUAPI;
+
+ fn bind(name: &str) -> Result<Self::Bind, Self::Error>;
+}