aboutsummaryrefslogtreecommitdiffstats
path: root/src/types/udp.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/types/udp.rs')
-rw-r--r--src/types/udp.rs8
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>;
}