Skip to content

Conversation

@zeenix
Copy link

@zeenix zeenix commented Nov 27, 2025

This is a no_std variant of std::io::Cursor.

Fixes #631.

The implementation was generated by an LLM by copying the std impl and adapting it. I (Zeeshan) reviewed the code and adjusted small bits. The tests added are a further assurance that the code is doing what it's supposed to do. Of course, it needs to be still reviewed by at least another person before we can be 100% certain about it.

This is a no_std variant of `std::io::Cursor`.

Fixes rust-embedded#631.

The implementation was generated by an LLM by copying the std impl and
adapting it. I (Zeeshan) reviewed the code and adjusted small bits. The
tests added are further guarantee that the code is doing what it's
supposed to do.
/// The standard library implements some I/O traits on various types which
/// are commonly used as a buffer, like `Cursor<Vec<u8>>` and `Cursor<&[u8]>`.
///
/// This is the `embedded-io` equivalent of [`std::io::Cursor`].
Copy link
Member

Choose a reason for hiding this comment

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

Maybe this should mention that this also took big parts of the implementation from std?
I'm not sure which amount of attribution is legally required by the licenses, but I think it's at least good style to disclose such copying.

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.

[Feature Request] Provide Cursor Implementation in embedded-io

2 participants