From e98e0538a574c51ad783dd46408d8d6ffff90cd7 Mon Sep 17 00:00:00 2001 From: Luni-4 Date: Wed, 17 Dec 2025 12:16:43 +0100 Subject: [PATCH 1/3] Update dependencies --- Cargo.toml | 6 +++--- edge-http/src/io.rs | 3 +++ edge-http/src/io/server.rs | 9 ++++++++- edge-nal-embassy/src/dns.rs | 9 +++++++++ edge-nal-embassy/src/tcp.rs | 15 +++++++++++++++ edge-nal-embassy/src/udp.rs | 17 +++++++++++++++++ edge-nal/src/timeout.rs | 2 ++ edge-raw/src/io.rs | 3 +++ 8 files changed, 60 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a12b15b..b7a976c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -110,9 +110,9 @@ members = [ [workspace.dependencies] embassy-futures = { version = "0.1.2", default-features = false } embassy-sync = { version = "0.7", default-features = false } -embassy-time = { version = "0.4", default-features = false } -embedded-io-async = { version = "0.6", default-features = false } -embedded-svc = { version = "0.28", default-features = false } +embassy-time = { version = "0.5", default-features = false } +embedded-io-async = { version = "0.7", default-features = false } +embedded-svc = { git = "https://github.com/Luni-4/embedded-svc", branch = "deps", version = "0.28", default-features = false } heapless = { version = "0.8", default-features = false } domain = { version = "0.10", default-features = false, features = ["heapless"] } diff --git a/edge-http/src/io.rs b/edge-http/src/io.rs index c2f4b2a..05f931c 100644 --- a/edge-http/src/io.rs +++ b/edge-http/src/io.rs @@ -82,6 +82,9 @@ impl From for Error { } } +#[cfg(not(feature = "std"))] +impl core::error::Error for Error {} + impl embedded_io_async::Error for Error where E: embedded_io_async::Error, diff --git a/edge-http/src/io/server.rs b/edge-http/src/io/server.rs index 4c49626..1c282c0 100644 --- a/edge-http/src/io/server.rs +++ b/edge-http/src/io/server.rs @@ -584,10 +584,17 @@ where } } +#[cfg(not(feature = "std"))] +impl core::error::Error + for HandleRequestError +{ +} + +#[cfg(not(feature = "std"))] impl embedded_io_async::Error for HandleRequestError where C: Debug + embedded_io_async::Error, - E: Debug, + E: Debug + Display, { fn kind(&self) -> embedded_io_async::ErrorKind { match self { diff --git a/edge-nal-embassy/src/dns.rs b/edge-nal-embassy/src/dns.rs index 187469e..ed3444d 100644 --- a/edge-nal-embassy/src/dns.rs +++ b/edge-nal-embassy/src/dns.rs @@ -1,3 +1,4 @@ +use core::fmt; use core::net::IpAddr; use edge_nal::AddrType; @@ -65,6 +66,14 @@ impl From for DnsError { } } +impl fmt::Display for DnsError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{:?}", self.0) + } +} + +impl core::error::Error for DnsError {} + impl embedded_io_async::Error for DnsError { fn kind(&self) -> ErrorKind { ErrorKind::Other diff --git a/edge-nal-embassy/src/tcp.rs b/edge-nal-embassy/src/tcp.rs index 9cc7c1c..3f5267a 100644 --- a/edge-nal-embassy/src/tcp.rs +++ b/edge-nal-embassy/src/tcp.rs @@ -1,3 +1,4 @@ +use core::fmt; use core::net::SocketAddr; use core::pin::pin; use core::ptr::NonNull; @@ -327,6 +328,20 @@ impl From for TcpError { } } +impl fmt::Display for TcpError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::General(e) => write!(f, "General: {:?}", e), + Self::Connect(e) => write!(f, "Connect: {:?}", e), + Self::Accept(e) => write!(f, "Accept: {:?}", e), + Self::NoBuffers => write!(f, "No buffers"), + Self::UnsupportedProto => write!(f, "Unsupported protocol"), + } + } +} + +impl core::error::Error for TcpError {} + impl embedded_io_async::Error for TcpError { fn kind(&self) -> ErrorKind { match self { diff --git a/edge-nal-embassy/src/udp.rs b/edge-nal-embassy/src/udp.rs index 68fae4f..63c0d07 100644 --- a/edge-nal-embassy/src/udp.rs +++ b/edge-nal-embassy/src/udp.rs @@ -1,3 +1,4 @@ +use core::fmt; use core::net::{Ipv4Addr, Ipv6Addr, SocketAddr}; use core::ptr::NonNull; @@ -340,6 +341,22 @@ impl From for UdpError { } } +impl fmt::Display for UdpError { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Self::Recv(e) => write!(f, "Receiver: {:?}", e), + Self::Send(e) => write!(f, "Sender: {:?}", e), + Self::Bind(e) => write!(f, "Binder: {:?}", e), + Self::MulticastGroupTableFull => write!(f, "Multicast group table full"), + Self::MulticastUnaddressable => write!(f, "Multicast unaddressable"), + Self::NoBuffers => write!(f, "No buffers"), + Self::UnsupportedProto => write!(f, "Unsupported protocol"), + } + } +} + +impl core::error::Error for UdpError {} + impl embedded_io_async::Error for UdpError { fn kind(&self) -> ErrorKind { match self { diff --git a/edge-nal/src/timeout.rs b/edge-nal/src/timeout.rs index c0b60e1..d23aaed 100644 --- a/edge-nal/src/timeout.rs +++ b/edge-nal/src/timeout.rs @@ -45,6 +45,8 @@ where } } +impl core::error::Error for WithTimeoutError {} + impl embedded_io_async::Error for WithTimeoutError where E: embedded_io_async::Error, diff --git a/edge-raw/src/io.rs b/edge-raw/src/io.rs index 89d2bf8..ecf305c 100644 --- a/edge-raw/src/io.rs +++ b/edge-raw/src/io.rs @@ -22,6 +22,9 @@ impl From for Error { } } +#[cfg(not(feature = "std"))] +impl core::error::Error for Error {} + impl embedded_io_async::Error for Error where E: embedded_io_async::Error, From c3bb054748e2e90e92b03db65b6d73fec8df9bc8 Mon Sep 17 00:00:00 2001 From: Luni-4 Date: Wed, 17 Dec 2025 16:09:37 +0100 Subject: [PATCH 2/3] Update dev-dependencies --- Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b7a976c..0438201 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,11 +38,11 @@ edge-nal-embassy = { workspace = true, optional = true } log = "0.4" anyhow = "1" env_logger = "0.10" -embedded-io-async = "0.6" -embassy-time = { version = "0.4", features = ["std", "generic-queue-64"] } +embedded-io-async = "0.7" +embassy-time = { version = "0.5", features = ["std", "generic-queue-64"] } embassy-sync = "0.7" embassy-futures = "0.1.2" -embedded-svc = { version = "0.28", features = ["std"] } +embedded-svc = { git = "https://github.com/Luni-4/embedded-svc", branch = "deps", version = "0.28", features = ["std"] } futures-lite = "2" rand = "0.8" tokio = "1" # For the `mqtt_client` example From d0838e650d1346f7c1ab50bcd0b4d7bb4b6893e5 Mon Sep 17 00:00:00 2001 From: Luni-4 Date: Wed, 17 Dec 2025 16:12:09 +0100 Subject: [PATCH 3/3] Update minimal Rust version --- .github/workflows/ci.yml | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 09f0845..4cb3b62 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,7 +18,7 @@ jobs: matrix: rust_toolchain: - nightly - - 1.83 # MSRV + - 1.87 # MSRV steps: - name: Setup | Checkout diff --git a/Cargo.toml b/Cargo.toml index 0438201..945d92d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ description = "no_std and no-alloc async implementations of various network prot repository = "https://github.com/ivmarkov/edge-net" license = "MIT OR Apache-2.0" readme = "README.md" -rust-version = "1.83" +rust-version = "1.87" [features] default = ["io"]