All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Remove
DynStorageImpl
as nobody used it BECAUSE it did not have a public constructor ANYWAY - Add serde defaults to the client configuration struct (#78)
- Derive Equality traits for OTA slots (#79)
- Add configuration for Protected Management Frames and scan methods to
wifi::ClientConfiguration
- Removed the
no-std-net
dependency in favor ofcore::net
which is stable since Rust 1.77 - Due to the above, module
ipv4
no longer re-exportsToSocketAddrs
withfeature = "std"
enabled as this trait is not available incore::net
(and might completely stop re-exportingcore::net
types in future)
- Fix clippy duplicate imports warnings with latest 1.78 nightly
- MAJOR CLEANUP/REMOVAL of obscure/rarely used trait modules:
sys_time
ping
timer
(as there isembedded_hal::delay
and more importantly -embedded_hal_async::delay
)event_bus
ws::callback_server
- COMPLETE REMOVAL of the following utility modules:
asyncify
- all functionality which still made sense merged intoesp-idf-svc
utils::mutex
- this was a helper module forasyncify
, so removed completely
- New module:
channel
; similar to cratechannel-bridge
but with less constraints on the data being sent/received - Breaking change in modules
mqtt::client
andutils::mqtt::client
: TheEvent
structure, and its associatedMessage
andMessageImpl
traits simplified significantly, allowing for much more ergonomic event processing, thanks to GATs and async-fn-in-trait which are now stable:- Introduced a new single-method trait:
Event
with methodpayload
returningEventPayload
- Introduced a new enumeration -
EventPayload
- modeling all possible event types that can be received from the MQTT client Message
andMessageImpl
retired
- Introduced a new single-method trait:
- Breaking change in module
http::server
:HandlerError
andHandlerResult
are now gone.- The blocking and async versions of the
Handler
andMiddleware
traits now all have an associatedError
type that the user can define however she wants (only requirement is for it to implementDebug
) - Additionally, the blocking and async versions of
Middleware
are now generified by theHandler
type, so that they have access to the Handler's error type and are therefore free to implement their error type in terms of a composition between the handler error type and the error types of other functions they are calling
- The blocking and async versions of the
- Bumped the MSRV version to 1.75 and removed the
nightly
feature requirement from all async traits - The
serde
dependency is now optional - Update to
heapless
0.8
- Updated changelog
- BREAKING CHANGE IN A PATCH RELEASE DUE TO DISCOVERED UB: Traits
EventBus
andTimerService
no longer allow subscriptions with non-static callbacks, as these are impossible to implement safely on ESP IDF
- A temporary workaround for rust-lang/rust#117602
- Rolled back a change where
event_bus::asynch::Sender
andevent_bus::asynch::Receiver
did no longer implementErrorType
and returned aResult
; since these traits are rarely used (featurenightly
only), and 0.26.0 was just released, no new major version was released, but instead 0.26.0 was yanked
- MSRV raised to 1.71
- Breaking change: All traits converted to AFIT, except
Unblocker
, which needs to compile with stable Rust - Breaking change: Upgraded to
embedded-io
0.5 andembedded-io-async
0.5 - Upgraded
strum
andstrum-macros
to 0.25 - OTA: New method:
Ota::finish
that allows to postpone/avoid setting the updated partition as a boot one - TimerService:
TimerService::timer
now takes&self
instead of&mut self
- for both blocking and async traits - Breaking change: TimerService: scoped handler: the timer callback now only needs to live as long as the
TimerService::Timer
associated type. Therefore,TimerService::Timer
is now lifetimed:TimerService::Timer<'a>
- Breaking change: TimerService:
TimerService::Timer
now borrows fromTimerService
. Therefore, that's another reason whyTimerService::Timer
is now lifetimed:TimerService::Timer<'a>
- Breaking change: EventBus: scoped handler: the subscription callback now only needs to live as long as the
EventBus::Subscription
associated type. Therefore,EventBus::Subscription
is now lifetimed:EventBus::Subscription<'a>
- Breaking change: EventBus:
EventBus::Subscription
now borrows fromEventBus
. Therefore, that's another reason whyEventBus::Subscription
is now lifetimed:EventBus::Subscription<'a>
- Breaking change: ws::Acceptor: the blocking as well as the async version now return
Connection
/Sender
/Receiver
instances which borrow fromAcceptor
- Breaking change: Unblocker: scoped handler: the callback now only needs to live as long as the
Unblocker::UnblockFuture
associated type. Therefore,Unblocker::UnblockFuture
is now lifetimed:Unblocker::UnblockFuture<'a, ...>
- Breaking change: Unblocker:
Unblocker::UnblockFuture
now borrows fromUnblocker::UnblockFuture
. Therefore, that's another reason whyUnblocker::UnblockFuture
is now lifetimed:Unblocker::UnblockFuture<'a, ...>
- Breaking change: OTA: GAT
Ota::Update
now parametric over lifetime and no longer returned by&mut
ref - Breaking change: OTA:
OtaUpdate::abort
andOtaUpdate::complete
now takeself
instead of&mut self
- Breaking change: MQTT: GAT
Connection::Message
now parametric over lifetime - Breaking change: Ping: Callback function of
Ping::ping_details
can now beFnMut
but does requireSend
- Breaking change: All pub structs in
utils::asyncify
that implement theFuture
trait are now private and wrapped with async methods - Breaking change: Removed structs
Blocking
andTrivialAsync
, as well as all trait implementations on them, because their usefulness was questionable - Breaking change: Removed the deprecated module
httpd
and the dependency onanyhow
- Compatibility with latest Rust nightly Clippy (fixes the "usage of
Arc<T>
whereT
is notSend
orSync
" error)
- Yanked; first attempt at ^^^
- Compatibility with latest Rust nightly (fixes the
can't leak private types
error)
- MSRV 1.66 (but MSRV 1.70 necessary if
embedded-io-async
is enabled) - Remove the
experimental
status from all traits - Remove the
nightly
feature flag guard from allasyncify
utilities as Rust GATs are stable now - Async
Wifi
andEth
traits defmt
support- Mask the SSID password in Wifi
ClientConfiguration
- Switch from
futures
to theatomic_waker
crate in theasyncify
utilities - Minor breaking change:
is_up
renamed tois_connected
in theEth
trait - Upgrade to
embedded-io
0.4 (but still stay away from switching the async traits to theasync
syntax)
HTTP server traits:
- Change the signatures of
Handler
,Middleware
,asynch::Handler
andasynch::Middleware
so that middleware implementations can use the HTTP connection after the handler has finished execution - Remove the
handler
utility method, as it was adding little value besides callingFnHandler::new()
- Remove the
FnConnectionHandler
FnHandler
implementation, as it was confusing to have it in addition to theFnHandler
implementation
- Const functions for strum_enums
- Defmt support
Patch release to fix compilation errors under no_std.
Release 0.23 is a backwards-incompatible release where almost all traits were touched in one way or another.
The main themes of the 0.23 release are:
- Lose weight - the
utils
module was reduced to the bare minimum necessary. After all, the main goal of this crate is to provide traits, not utilities - In addition to all traits being implementable in
no_std
environments, make sure they do not have explicit or implicit dependencies on an allocator being available (the Rustalloc
module) - Improve the experimental HTTP client and server traits
- Separate the notions of using a "nightly" compiler (which is a precondition for all async support) from "experimental" features, which might or might not be async-related
This module is now moved to a separate micro-crate: channel-bridge
. The traits in embedded-svc
no longer depend on the generic Receiver
and Sender
traits the channel
module used to provide.
This module is completely retired, as it used to provide utilities (EitherErrorXX
) which were anyway used only by a handful of the traits in embedded-svc
.
Those traits now use their own custom error types.
TransitionalState
struct is retired. The Eth
trait is redesigned to have explicit start
and stop
methods, as well as is_started
and is_up
methods that to some extent provide the functionality
which used to be available via the now-retired get_status
method.
Furthermore, the Eth
trait now no longer assumes that the driver implementing it is capable of operating above the OSI Layer-2. In other words, a driver implementing the Eth
trait might, or might not bring up an IP-level stack. As such, all structures related to "IP" are retired or moved to the ipv4
module.
- All trait methods on the blocking traits now take
&self
instead of&mut self
. Given thatEventBus
andPostbox
are essentially a publish-subscribe channel in disguise this makes a lot of sense - Implement
EventBus
andPostbox
for& T
and&mut T
PinnedEventBus
is now retired, as its usefulness was queztionable (it was only lifting theSend
requirement on the subscription callback)- Async traits: remove the dependency on
channel::Receiver
andchannel::Sender
- All existing traits retired, as they cannot be implemented without an allocator being available (i.e. not implementable on top of the
embassy-executor
crate) - New traits (and utility structs around them):
Blocker
andUnblocker
. Note thatUnblocker
is currently not possible to implement without an allocation either, but it was kept for completeness.
This module underwent complete refactoring. Major changes:
Connection
trait: this is the major HTTP abstraction for both client code and server handlers. Amongst other reasons, introducing this trait solves the problem where the underlying TCP socket abstraction cannot be split into separate "reader" and "writer". Note that certain methods of theConnection
trait can only be called when the connection is in a certain state (i.e. "client request submitted" phase vs "client request submitted" phase) and will panic otherwise. There are two safe, non-panicking wrappers ofConnection
for both HTTP client and server:Request
andResponse
, where the recommendation for user code is to use theConnection
trait via theRequest
wrapper (Request
is automatically turned intoResponse
once the request is submitted)- On error, the server
Handler
trait is now required to return a dedicatedHandlerError
structure, which is just a wrapper around an error message.HandlerError
is expected to be turned into an HTTP 500 response by trait implementors. The generifiedE: Debug
error that used to be returned by theHandler
trait introduced a very complex lifetime handling in user code and was therefore retired. Note that sinceHandlerError
does not allocate, the maximum error message that it can contain is 64 characters. Longer messages are automatically truncated. - The
registry
module is removed, as theRegistry
trait was impossible to implement without allocations. Instead, the newutils::http::registry
utility is offered Query
trait, allowing user to retrive the HTTP method and URI- Implement traits on
& T
and&mut T
where appropriate headers
module with utility functions for building a headers' array for submissionBlocking
andTrivialUnblocking
adaptors from async to blocking traits and vice versaHeader
utility inutils::http
- The
session
module is significantly simplified and moved toutils::http::session
- The
cookies
module is moved toutils::http::cookies
This module is now marked as deprecated. The successor is the http::server
module.
- Blocking and async utility methods like
read_max
andcopy
moved toutils::io
Configuration
struct describing the IP-related configuration of network interfaces, along with an accopmanyingInterface
trait
&mut T
traits implementations
- Retired as it used GATs. While GATs are stable in the meantime, this trait still had open questions around it, as in the "guard" pattern it standardizes is not really embraced by the embedded community. Use the raw
BlockingMutex
trait provided by theembassy-sync
crate along with its ergonomic typed wrapper, or - for STD-only environments - the STDMutex
directly.
OtaServer
retired. This trait had nothing to do with the capabilities of the device itself in terms of OTA support, and modeled a generic "OTA server". While perhaps a useful concept, it might had been too early for thatSlot
trait turned into a structure, similar toFirmware
. This enabled GAT-free blocking traits. While GATs are now getting stabilized, we still try to use those only for async traits, where they are absolute necessity- Implement
Ota
for&mut T
- Implement
Ping
for&mut T
StorageImpl
- out of the boxStorage
implementation based onRawStorage
impl andSerDe
impl provided by the user
& T
and&mut T
impls where appropriate
- Removed, see the
executor
module for a suitable replacement
Retired copies of async utilities available in other crates:
signal
,mutex
,channel
(were copied from theembassy-sync
crate, which is now published on crates.io)yield_now
,select
(were copied from theembassy-futures
crate, which is now published on crates.io)forever
(were copied from thestatic_cell
crate, which is now published on crates.io)
Utilities moved to other crates:
executor
- available as a separateedge-executor
micro-crate nowghota
- available as a separateghota
micro-crate nowcaptive
- available as part of theedge-net
crate nowrole
- available as part of theedge-frame
crate now
Completely retired utilities:
rest
json_io
This is a module that provides mutex and condvar abstractions, but with the caveat that these abstractions are supposed to only be used by:
- Other utilities in the
utils
module, namely theutils::asyncify
module, and the helperutils::mqtt
module (the latter can optionally be used by implementors of the synchronousmqtt
traits) - Implementors of the
embedded-svc
traits
It is not intended for general, public use. If users need a synchronous mutex or condvar abstractions for their application code, they are strongly encouraged to use one of the following options:
- For STD-compatible environments, the mutex and condvar abstractions provided by the Rust STD library itself
- For no_std environments, one of the following:
- The synchronous mutex abstractions provided by the
embassy-sync
crate - The critical section provided by the
critical-section
crate - Note that the no_std options above only provide a mutex abstration. If users need a condvar abstraction (usually only the case for RTOS environments which provde a thread/task notion), they should use the native condvar facilities of their RTOS
Furthermore:
- When the
embedded-svc
utilities are used in a STD-compatible environment, the mutex and condvar abstractions ofutils::mutex
are already implemented in terms of Rust's STD mutex and condvar abstractions, and users should not be concerned with this module at all - When the
embedded-svc
utilities are used in a no_std environment (i.e., an RTOS that provides blocking synchronization primitives, as well as the notion of task/threads but these are not Rust STD compatible), users are required to provide implementations of theRawMutex
andRawCondvar
traits
TransitionalState
struct is retired. The Wifi
trait is redesigned to have explicit start
, stop
, connect
and disconnect
methods, as well as is_started
and is_connected
methods that to some extent provide the functionality
which used to be available via the now-retired get_status
method.
Furthermore, the Wifi
trait now no longer assumes that the driver implementing it is capable of operating above the OSI Layer-2. In other words, a driver implementing the Wifi
trait might, or might not bring up an IP-level stack. As such, all structures related to "IP" are retired or moved to the ipv4
module.