aboutsummaryrefslogtreecommitdiffstats
path: root/src/router/types.rs
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2019-08-26 15:01:47 +0200
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2019-08-26 15:01:47 +0200
commite16151419d710194f5dfb24dd1a71e04add4964e (patch)
tree857804b5be9ca8ee2033abaf9d97f264f36d5e13 /src/router/types.rs
parentUpdate the blake2 crate to fix bug upstream (diff)
downloadwireguard-rs-e16151419d710194f5dfb24dd1a71e04add4964e.tar.xz
wireguard-rs-e16151419d710194f5dfb24dd1a71e04add4964e.zip
Work on callback structure for cryptkey router
Diffstat (limited to 'src/router/types.rs')
-rw-r--r--src/router/types.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/router/types.rs b/src/router/types.rs
new file mode 100644
index 0000000..0b5e162
--- /dev/null
+++ b/src/router/types.rs
@@ -0,0 +1,7 @@
+pub trait Opaque: Send + Sync + 'static {}
+
+impl<T> Opaque for T where T: Send + Sync + 'static {}
+
+pub trait Callback<T>: Fn(&T, bool) -> () + Sync + Send + 'static {}
+
+impl<T, F> Callback<T> for F where F: Fn(&T, bool) -> () + Sync + Send + 'static {}