Skip to content

Conversation

@magravel
Copy link
Contributor

@magravel magravel commented Jun 2, 2025

This PR adds a sync version of CfuWriter and merged CfuWriterMut with CfuWriter.

  • The previous CfuWriter is now named CfuWriterAsync and the synchronous version is named CfuWriterSync. To keep the previous behavior, use CfuWriterAsync.
  • Rename the Default Writer to CfuWriterNop to be more explicit about what it does.
  • Removed default implementations that were not default behavior. The reason for the change, add clarity to the user about which function needs to be implemented to have a working writer and will "force" the use to implement these functions. In the event where someone wants a dummy implementation, the intent will be clearer now that it is moved where the implementation is.

Issues

Fix #5
Fix #17

@magravel magravel marked this pull request as ready for review June 5, 2025 17:49
@magravel magravel force-pushed the magravel/small_improvements branch from 4c977d3 to 5cf94f3 Compare June 5, 2025 20:54
@felipebalbi felipebalbi added the BREAKING CHANGE Used for any breaking changes label Jun 6, 2025
@felipebalbi felipebalbi moved this to In review in Embedded Controller Jun 6, 2025
@magravel magravel force-pushed the magravel/small_improvements branch 2 times, most recently from e5fe69b to 93cc60a Compare June 9, 2025 23:30
remove send and add noop writer.

revmove default impl

cargo fmt

cargo clippy

review fix

cargo +nightly fmt

fix doc all features

cargo fmt line with 100

Noop -> Nop

fmt

remove send trait, future pr

add mut to self in writer trait

cargo fmt

cargo +nightly fmt

try to make the ci fmt works :(
@magravel magravel force-pushed the magravel/small_improvements branch from 93cc60a to 43eafb0 Compare June 9, 2025 23:32
RobertZ2011
RobertZ2011 previously approved these changes Jun 10, 2025
madeleyneVaca
madeleyneVaca previously approved these changes Jun 11, 2025
@madeleyneVaca
Copy link
Contributor

Should I increment the version to 0.2.0 since there is a breaking change?

Yes

@magravel magravel dismissed stale reviews from madeleyneVaca and RobertZ2011 via 92da99b June 16, 2025 21:22
@magravel magravel requested a review from a team as a code owner June 26, 2025 22:11
@magravel magravel requested a review from kurtjd June 26, 2025 22:11
@magravel
Copy link
Contributor Author

magravel commented Jul 2, 2025

Hi, I looked at the maybe-async-cfg crate. Having a Sync version of CfuWrite is to be used when small packets need to be sent. In that case, the use of a non-async API could result in better performance. In a project containing these use cases, it is expected to use both sync and async versions of the CfuWriter. Adding a feature to the build to have or not the sync version adds lots of complexity and no benefit in this use case. One benefit could be that we do not have to write the trait implementation twice, but since for now it is only four lines, adding a macro to the code and new dependencies seems overkill.

@kurtjd kurtjd enabled auto-merge (squash) July 2, 2025 21:36
@kurtjd kurtjd merged commit 7b0a30f into OpenDevicePartnership:main Jul 2, 2025
9 checks passed
@github-project-automation github-project-automation bot moved this from In review to Done in Embedded Controller Jul 2, 2025
kurtjd pushed a commit to OpenDevicePartnership/embedded-services that referenced this pull request Jul 7, 2025
…ge (#384)

There was a breaking change and minor version update (0.2.0) in
embedded-cfu via
OpenDevicePartnership/embedded-cfu#21. While the
necessary changes are integrated, limit version to 0.1.0 for the
workspace in cargo.toml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BREAKING CHANGE Used for any breaking changes

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Removing CfuWriterMut trait and use CfuWriter instead Add Blocking support for Host and CfuWriter traits

7 participants