aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2019-08-31 21:00:10 +0200
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2019-08-31 21:00:10 +0200
commitd16521f4c75ebee6fa068461693755a5c1863e9f (patch)
tree4eb1ace931180cee33d956da4a000c02377eb525 /src/main.rs
parentReduce number of type parameters in router (diff)
downloadwireguard-rs-d16521f4c75ebee6fa068461693755a5c1863e9f.tar.xz
wireguard-rs-d16521f4c75ebee6fa068461693755a5c1863e9f.zip
Added Bind trait to router
Diffstat (limited to '')
-rw-r--r--src/main.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index cfe93eb..6d1d2e1 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -52,14 +52,14 @@ impl Tun for TunTest {
}
}
-struct Test {}
+struct BindTest {}
-impl Bind for Test {
+impl Bind for BindTest {
type Error = BindError;
type Endpoint = SocketAddr;
- fn new() -> Test {
- Test {}
+ fn new() -> BindTest {
+ BindTest {}
}
fn set_port(&self, port: u16) -> Result<(), Self::Error> {
@@ -111,6 +111,7 @@ fn main() {
let router = router::Device::new(
4,
TunTest {},
+ BindTest {},
|t: &PeerTimer, data: bool, sent: bool| t.a.reset(Duration::from_millis(1000)),
|t: &PeerTimer, data: bool, sent: bool| t.b.reset(Duration::from_millis(1000)),
|t: &PeerTimer| println!("new key requested"),