diff options
author | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2019-08-28 16:27:26 +0200 |
---|---|---|
committer | Mathias Hall-Andersen <mathias@hall-andersen.dk> | 2019-08-28 16:27:26 +0200 |
commit | 6785aa4cb56833131b69f4d2b44301908b1a1b4c (patch) | |
tree | d9dc6ec7a3c45291f44ae3e8d707200a1b1da410 /src/router/types.rs | |
parent | Renamed confirmed -> initator on keypair (diff) | |
download | wireguard-rs-6785aa4cb56833131b69f4d2b44301908b1a1b4c.tar.xz wireguard-rs-6785aa4cb56833131b69f4d2b44301908b1a1b4c.zip |
Join with worker threads on device drop
Diffstat (limited to 'src/router/types.rs')
-rw-r--r-- | src/router/types.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/router/types.rs b/src/router/types.rs index 2ed011b..3d486bc 100644 --- a/src/router/types.rs +++ b/src/router/types.rs @@ -3,7 +3,7 @@ pub trait Opaque: Send + Sync + 'static {} impl<T> Opaque for T where T: Send + Sync + 'static {} /// A send/recv callback takes 3 arguments: -/// +/// /// * `0`, a reference to the opaque value assigned to the peer /// * `1`, a bool indicating whether the message contained data (not just keepalive) /// * `2`, a bool indicating whether the message was transmitted (i.e. did the peer have an associated endpoint?) @@ -12,8 +12,14 @@ pub trait Callback<T>: Fn(&T, bool, bool) -> () + Sync + Send + 'static {} impl<T, F> Callback<T> for F where F: Fn(&T, bool, bool) -> () + Sync + Send + 'static {} /// A key callback takes 1 argument -/// +/// /// * `0`, a reference to the opaque value assigned to the peer pub trait KeyCallback<T>: Fn(&T) -> () + Sync + Send + 'static {} -impl<T, F> KeyCallback<T> for F where F: Fn(&T) -> () + Sync + Send + 'static {}
\ No newline at end of file +impl<T, F> KeyCallback<T> for F where F: Fn(&T) -> () + Sync + Send + 'static {} + +pub trait TunCallback<T>: Fn(&T, bool, bool) -> () + Sync + Send + 'static {} + +pub trait BindCallback<T>: Fn(&T, bool, bool) -> () + Sync + Send + 'static {} + +pub trait Endpoint: Send + Sync {} |