Skip to content

io: expand docs.#469

Merged
eldruin merged 1 commit into
masterfrom
io-docs
Jul 12, 2023
Merged

io: expand docs.#469
eldruin merged 1 commit into
masterfrom
io-docs

Conversation

@Dirbaio

@Dirbaio Dirbaio commented Jul 12, 2023

Copy link
Copy Markdown
Member

depends on #466

  • Document semantics of methods, no more "read std::io docs".
  • Document differences from std::io
    • Error is an associated type now
    • std::io might be blocking or nonblocking, embedded-io is always blocking.
  • Document gotchas with ReadReady/WriteReady usage.
  • Document cancel-side-effect-free-ness on async.

@Dirbaio Dirbaio requested a review from a team as a code owner July 12, 2023 13:04

@eldruin eldruin left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

@eldruin eldruin added this pull request to the merge queue Jul 12, 2023
Merged via the queue into master with commit 27be7bc Jul 12, 2023
aki1770-del added a commit to aki1770-del/embedded-hal that referenced this pull request Apr 11, 2026
…dded#719)

The previous documentation used permissive language ("encouraged",
"implementations should document") that left callers uncertain about
what happens to data in flight when a future is dropped mid-transfer.

Replace the vague encouragement with normative documentation that:
- States explicitly the method is NOT cancel-safe by default
- Describes the concrete failure mode: bytes already received from
  hardware FIFO/DMA may be silently discarded with no error returned
- Uses SHOULD/MUST language consistent with the rest of the trait docs
- Mentions the CancelSafeRead marker trait path for future opt-in
- Gives callers actionable guidance (run future to completion)

This follows the pattern established by Tokio's cancel-safety
documentation and PR rust-embedded#469 ("io: expand docs"), closing the gap that
issue rust-embedded#719 identified.

Fixes rust-embedded#719

Signed-off-by: aki1770-del <aki1770@gmail.com>
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.

2 participants