Skip to content

Commit

Permalink
Merge pull request #88 from Dirbaio/master
Browse files Browse the repository at this point in the history
Update to embedded-io v0.5, release -nal-async v0.5
  • Loading branch information
ryan-summers authored Aug 7, 2023
2 parents afdbe62 + d5b0179 commit d1d5add
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
8 changes: 7 additions & 1 deletion embedded-nal-async/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

No unreleased changes yet.

## [0.5.0] - 2023-08-07

- Let `&T` for `T: Dns` implement `Dns`
- Bumped to `embedded-nal` 0.7
- Bumped to `embedded-io-async` 0.5

## [0.4.0] - 2023-01-27

Expand All @@ -28,6 +33,7 @@ Remove TcpClientStack, TcpFullStack and UDP traits pending traits that support s

Initial release to crates.io.

[Unreleased]: https://github.com/rust-embedded-community/embedded-nal/compare/embedded-nal-async-v0.4.0...HEAD
[Unreleased]: https://github.com/rust-embedded-community/embedded-nal/compare/embedded-nal-async-v0.5.0...HEAD
[0.5.0]: https://github.com/rust-embedded-community/embedded-nal/compare/embedded-nal-async-v0.4.0...embedded-nal-async-v0.5.0
[0.4.0]: https://github.com/rust-embedded-community/embedded-nal/compare/embedded-nal-async-v0.3.0...embedded-nal-async-v0.4.0
[0.1.0]: https://github.com/rust-embedded-community/embedded-nal/releases/tag/embedded-nal-async-v0.1.0
4 changes: 2 additions & 2 deletions embedded-nal-async/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "embedded-nal-async"
version = "0.4.0"
version = "0.5.0"
edition = "2021"
description = "An Async Network Abstraction Layer (NAL) for Embedded Systems"
license = "MIT OR Apache-2.0"
Expand All @@ -18,4 +18,4 @@ ip_in_core = []
no-std-net = "0.6"
heapless = "^0.7"
embedded-nal = { version = "0.7.0", path = "../" }
embedded-io = { version = "0.4.0", default-features = false, features = ["async"] }
embedded-io-async = { version = "0.5.0" }
8 changes: 4 additions & 4 deletions embedded-nal-async/src/stack/tcp.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
use crate::SocketAddr;

/// This trait is implemented by TCP/IP stacks. The trait allows the underlying driver to
/// construct multiple connections that implement the I/O traits from embedded-io.
/// construct multiple connections that implement the I/O traits from embedded-io-async.
///
/// The associated connection type should close the connection when dropped.
pub trait TcpConnect {
/// Error type returned on connect failure.
type Error: embedded_io::Error;
type Error: embedded_io_async::Error;

/// Type holding state of a TCP connection. Should close the connection when dropped.
type Connection<'a>: embedded_io::asynch::Read<Error = Self::Error>
+ embedded_io::asynch::Write<Error = Self::Error>
type Connection<'a>: embedded_io_async::Read<Error = Self::Error>
+ embedded_io_async::Write<Error = Self::Error>
where
Self: 'a;

Expand Down
8 changes: 4 additions & 4 deletions embedded-nal-async/src/stack/udp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use crate::SocketAddr;
/// address at connect time.
pub trait ConnectedUdp {
/// Error type returned by send and receive operations.
type Error: embedded_io::Error;
type Error: embedded_io_async::Error;

/// Send the provided data to the connected peer
async fn send(&mut self, data: &[u8]) -> Result<(), Self::Error>;
Expand Down Expand Up @@ -67,7 +67,7 @@ pub trait ConnectedUdp {
/// applicable. The implementer MAY check them for compatibility, and SHOULD do that in debug mode.
pub trait UnconnectedUdp {
/// Error type returned by send and receive operations.
type Error: embedded_io::Error;
type Error: embedded_io_async::Error;

/// Send the provided data to a peer
///
Expand Down Expand Up @@ -114,13 +114,13 @@ pub trait UnconnectedUdp {
}

/// This trait is implemented by UDP/IP stacks. The trait allows the underlying driver to
/// construct multiple connections that implement the I/O traits from embedded-io.
/// construct multiple connections that implement the I/O traits from embedded-io-async.
///
/// Note that stacks with exotic connection creation methods may still not implement this, yet have
/// objects that implement [`ConnectedUdp`] or similar.
pub trait UdpStack {
/// Error type returned on socket creation failure.
type Error: embedded_io::Error;
type Error: embedded_io_async::Error;

/// Eventual socket return type of the [`.connect()`] method
type Connected: ConnectedUdp<Error = Self::Error>;
Expand Down

0 comments on commit d1d5add

Please sign in to comment.