Skip to content

Conversation

@tage64
Copy link

@tage64 tage64 commented Oct 7, 2025

This PR implements the blocking traits from embedded-io. It refactors out the asynch module and makes the asynch traits available by a feature flag instead. Feel free to merge the PR, but it would require a breaking change.

  • Remove the asynch module and put the BufferedRead and BufferedWrite structs available on crate root.
  • Implement the blocking Read/Write traits from embedded-io.

Tage Johansson added 2 commits October 7, 2025 13:34
This commit makes embedded-io-async an optional dependency and creates a
feature ``async` that enables it. It also implements the blocking
Read/BufRead/Write traits from embedded-io and creates corresponding
tests.
@pantsman0
Copy link

@rmja +1 for this. Do you have any appetite for these changes?

I would love to use something like this for my port of the image crate for no_std+alloc envs.

@rmja
Copy link
Owner

rmja commented Nov 17, 2025

Is the recommendation nowadays to split the crates in two (like embedded-io or embedded-io-async), or is it to separate on features?

@pantsman0
Copy link

pantsman0 commented Nov 17, 2025

From my experience, there is still a pretty even split. Having them together can create churn if one side has a lot more changes than the other; but conversely, having them split may mean that consumers have to rely on both depending on their in downstream users.

I think, given that you have the async traits, it would be better to have both here and enable the async versions as a feature. Publishing a buffered-io-sync would be fine but kind of undesirable as async versions are usually the ones that are tagged, and moving the current types to a buffered-io-async breaks the crate for the current users.

@rmja
Copy link
Owner

rmja commented Nov 17, 2025

It is currently being investigated whether this should be included in embedded-io* directly. @lulf will get back.

@pantsman0
Copy link

Are you referring to rust-embedded/embedded-hal#627 ? That seems to be dead, but if there is discussion elsewhere I can jump in there

@lulf
Copy link
Contributor

lulf commented Nov 17, 2025

I didn't realize it had already been discussed. Seems like maybe splitting into buffered-io and buffered-io-async would be the best move?

@rmja
Copy link
Owner

rmja commented Nov 18, 2025

I think I agree. Please feel free to update this PR or create a new, then I will make sure that it gets merged and published.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants