diff options
author | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2019-10-23 12:08:35 +0200 |
---|---|---|
committer | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2019-10-23 12:08:35 +0200 |
commit | ee3599d5507ceee23ef3382dbda9de8e73c54a00 (patch) | |
tree | d681a3f8a5a2d5e7bea779acecd1fc0798285d9e /src/platform/tun.rs | |
parent | Work on platform specific code (Linux) (diff) | |
download | wireguard-rs-ee3599d5507ceee23ef3382dbda9de8e73c54a00.tar.xz wireguard-rs-ee3599d5507ceee23ef3382dbda9de8e73c54a00.zip |
Moved IO traits into platform module
Diffstat (limited to '')
-rw-r--r-- | src/platform/tun.rs (renamed from src/wireguard/types/tun.rs) | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/wireguard/types/tun.rs b/src/platform/tun.rs index 2ba16ff..f49d4af 100644 --- a/src/wireguard/types/tun.rs +++ b/src/platform/tun.rs @@ -54,3 +54,8 @@ pub trait Tun: Send + Sync + 'static { type MTU: MTU; type Error: Error; } + +/// On some platforms the application can create the TUN device itself. +pub trait Platform: Tun { + fn create(name: &str) -> Result<(Vec<Self::Reader>, Self::Writer, Self::MTU), Self::Error>; +} |