Using std::io::{Read, Write, Cursor} in a nostd environment
*[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust/issues/48331)* I'm surprised there's no ticket for this, so here we go. It isn't possible in nostd to use [std::io::Cursor](https://doc.rust-lang.org/std/io/struct.Cursor.html). That seems to be mostly because it requires std::io::Read, Write, and Seek. However, I'd argue that those traits should also be part of libcore, and only the specific implementations be in libstd. After all, the Read/Write/Seek traits and the Cursor struct don't seem to rely on anything that's part of the stdlib: they don't need allocation, etc... My use-case is, I have to write data into an array, and treating that array in a file would lead to much more idiomatic code. Furthermore it'd allow using crates like byteorder in nostd environment.
Posted by roblabla on Feb 18, 2018, 9:12 PM
Tags
Related issues
- Custom games stuck on "finding server" for all european servers
- Feature request: add ACP (Agent Client Protocol) stdio JSON-RPC mode
- Forza Horizon 6 (2483190)
- Turn off integrated browser for default
- Weekly updates are too frequent
- [BUG] Max 20x plan: 100% usage after 2 hours of light work (5 commits, no agents)
Raise real-world problems, find people facing the same issue, and discuss solutions.4,500 issues0 comments
github (Sysadmin)
Custom games stuck on "finding server" for all european servers
Feature request: add ACP (Agent Client Protocol) stdio JSON-RPC mode
Forza Horizon 6 (2483190)
Turn off integrated browser for default
Weekly updates are too frequent
[BUG] Max 20x plan: 100% usage after 2 hours of light work (5 commits, no agents)
Add gemini-3.1-pro-preview
[TF2] Feature request: Bring Back Quickplay
Using std::io::{Read, Write, Cursor} in a nostd environment
*[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust/issues/48331)* I'm surprised there's no ticket for this, so here we go. It isn't possible in nostd to use [std::io::Cursor](https://doc.rust-lang.org/std/io/struct.Cursor.html). That seems to be mostly because it requires std::io::Read, Write, and Seek. However, I'd argue that those traits should also be part of libcore, and only the specific implementations be in libstd. After all, the Read/Write/Seek traits and the Cursor struct don't seem to rely on anything that's part of the stdlib: they don't need allocation, etc... My use-case is, I have to write data into an array, and treating that array in a file would lead to much more idiomatic code. Furthermore it'd allow using crates like byteorder in nostd environment.
Comments (0)
No comments yet. Start the discussion.