diff options
Diffstat (limited to 'src/types/endpoint.rs')
-rw-r--r-- | src/types/endpoint.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/types/endpoint.rs b/src/types/endpoint.rs index 02682a9..261203f 100644 --- a/src/types/endpoint.rs +++ b/src/types/endpoint.rs @@ -1,5 +1,6 @@ use std::net::SocketAddr; -pub trait Endpoint: Into<SocketAddr> + From<SocketAddr> + Copy + Send {} - -impl<T> Endpoint for T where T: Into<SocketAddr> + From<SocketAddr> + Copy + Send {} +pub trait Endpoint: Send { + fn from_address(addr: SocketAddr) -> Self; + fn into_address(&self) -> SocketAddr; +} |