Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
matrix:
rust_toolchain:
- nightly
- 1.83 # MSRV
- 1.87 # MSRV

steps:
- name: Setup | Checkout
Expand Down
14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"] }

Expand Down
3 changes: 3 additions & 0 deletions edge-http/src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ impl<E> From<UpgradeError> for Error<E> {
}
}

#[cfg(not(feature = "std"))]
impl<E: embedded_io_async::Error> core::error::Error for Error<E> {}

impl<E> embedded_io_async::Error for Error<E>
where
E: embedded_io_async::Error,
Expand Down
9 changes: 8 additions & 1 deletion edge-http/src/io/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -584,10 +584,17 @@ where
}
}

#[cfg(not(feature = "std"))]
impl<C: Debug + embedded_io_async::Error, E: Debug + Display> core::error::Error
for HandleRequestError<C, E>
{
}

#[cfg(not(feature = "std"))]
impl<C, E> embedded_io_async::Error for HandleRequestError<C, E>
where
C: Debug + embedded_io_async::Error,
E: Debug,
E: Debug + Display,
{
fn kind(&self) -> embedded_io_async::ErrorKind {
match self {
Expand Down
9 changes: 9 additions & 0 deletions edge-nal-embassy/src/dns.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use core::fmt;
use core::net::IpAddr;

use edge_nal::AddrType;
Expand Down Expand Up @@ -65,6 +66,14 @@ impl From<Error> 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
Expand Down
15 changes: 15 additions & 0 deletions edge-nal-embassy/src/tcp.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use core::fmt;
use core::net::SocketAddr;
use core::pin::pin;
use core::ptr::NonNull;
Expand Down Expand Up @@ -327,6 +328,20 @@ impl From<AcceptError> 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 {
Expand Down
17 changes: 17 additions & 0 deletions edge-nal-embassy/src/udp.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use core::fmt;
use core::net::{Ipv4Addr, Ipv6Addr, SocketAddr};
use core::ptr::NonNull;

Expand Down Expand Up @@ -340,6 +341,22 @@ impl From<embassy_net::MulticastError> 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 {
Expand Down
2 changes: 2 additions & 0 deletions edge-nal/src/timeout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ where
}
}

impl<E: embedded_io_async::Error> core::error::Error for WithTimeoutError<E> {}

impl<E> embedded_io_async::Error for WithTimeoutError<E>
where
E: embedded_io_async::Error,
Expand Down
3 changes: 3 additions & 0 deletions edge-raw/src/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ impl<E> From<raw::Error> for Error<E> {
}
}

#[cfg(not(feature = "std"))]
impl<E: embedded_io_async::Error> core::error::Error for Error<E> {}

impl<E> embedded_io_async::Error for Error<E>
where
E: embedded_io_async::Error,
Expand Down
Loading