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/types/udp.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/types/udp.rs')
-rw-r--r-- | src/types/udp.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/types/udp.rs b/src/types/udp.rs index 00e218f..4bf0a9c 100644 --- a/src/types/udp.rs +++ b/src/types/udp.rs @@ -21,7 +21,9 @@ pub trait Bind: Send + Sync { fn set_port(&self, port: u16) -> Result<(), Self::Error>; /// Returns the current port of the bind - fn get_port(&self) -> u16; - fn recv(&self, dst: &mut [u8]) -> Self::Endpoint; - fn send(&self, src: &[u8], dst: &Self::Endpoint); + fn get_port(&self) -> Option<u16>; + + fn recv(&self, buf: &mut [u8]) -> Result<(usize, Self::Endpoint), Self::Error>; + + fn send(&self, buf: &[u8], dst: &Self::Endpoint) -> Result<(), Self::Error>; } |