From 977ce7a7838b3e5e6fb8069d19711ad6f1f372e5 Mon Sep 17 00:00:00 2001 From: Sympatron <35803463+Sympatron@users.noreply.github.com> Date: Thu, 3 Dec 2020 09:07:08 +0100 Subject: [PATCH 1/2] Renamed UDP/TCP traits to alleviate confusion --- src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 80f1c9d..b7f932a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -15,7 +15,7 @@ pub use no_std_net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, Socke /// which knows how to send AT commands to an ESP8266 WiFi module. You could have another implementation /// which knows how to driver the Rust Standard Library's `std::net` module. Given this trait, you can how /// write a portable HTTP client which can work with either implementation. -pub trait TcpClient { +pub trait TcpClientStack { /// The type returned when we create a new TCP socket type TcpSocket; /// The type returned when we have an error @@ -65,7 +65,7 @@ pub trait TcpClient { /// This trait is implemented by TCP/IP stacks that expose TCP server functionality. TCP servers /// may listen for connection requests to establish multiple unique TCP connections with various /// clients. -pub trait TcpServer: TcpClient { +pub trait TcpFullStack: TcpClientStack { /// Create a new TCP socket and bind it to the specified local port. /// /// Returns `Ok` when a socket is successfully bound to the specified local port. Otherwise, an @@ -93,7 +93,7 @@ pub trait TcpServer: TcpClient { /// module. You could have another implementation which knows how to driver the /// Rust Standard Library's `std::net` module. Given this trait, you can how /// write a portable CoAP client which can work with either implementation. -pub trait UdpClient { +pub trait UdpClientStack { /// The type returned when we create a new UDP socket type UdpSocket; /// The type returned when we have an error @@ -131,7 +131,7 @@ pub trait UdpClient { /// This trait is implemented by UDP/IP stacks. It provides the ability to /// listen for packets on a specified port and send replies. -pub trait UdpServer: UdpClient { +pub trait UdpFullStack: UdpClientStack { /// Bind a UDP socket with a specified port fn bind(&self, socket: &mut Self::UdpSocket, local_port: u16) -> Result<(), Self::Error>; From db0e30485e5f75a16f430cd94250f5b907d796e9 Mon Sep 17 00:00:00 2001 From: Sympatron <35803463+Sympatron@users.noreply.github.com> Date: Thu, 3 Dec 2020 10:26:24 +0100 Subject: [PATCH 2/2] Added changes to changelog --- CHANGELOG.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 638d6bc..063fa9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] -... + +### Changed +- Changed the names of `UdpClient`/`TcpClient` to `UdpClientStack`/`TcpClientStack` +- Changed the names of `UdpServer`/`TcpServer` to `UdpFullStack`/`TcpFullStack` ## [0.2.0] - 2020-12-02