Sub-task of #413.
What
Isolate all std-only I/O surfaces so they compile out when feature = "std" is not set:
src/readers/csv.rs: uses std::io::Read — wrap the entire module or the Read-dependent API in #[cfg(feature = "std")].
src/readers/error.rs: uses std::io error types — same gate.
src/dataset/mod.rs::serialize_data (lines 57–87): uses std::fs::File — already gated #[cfg(not(target_arch = "wasm32"))]; change to #[cfg(feature = "std")].
src/dataset/mod.rs::deserialize_data (lines 103–210): returns io::Error — replace with Failed or a custom no-std error enum so the deserialization algorithm remains available on embedded.
Notes
readers/ is already behind #[cfg(feature = "serde")]; the new std gate stacks on top.
postcard (the serde backend) supports no_std; verify no std::io types leak through its API at the use sites.
- This is the highest-risk step as it touches public API. Add or update compile-tests to confirm both
std and no-std paths build.
Acceptance
Estimated effort: ~2 hrs
Sub-task of #413.
What
Isolate all
std-only I/O surfaces so they compile out whenfeature = "std"is not set:src/readers/csv.rs: usesstd::io::Read— wrap the entire module or theRead-dependent API in#[cfg(feature = "std")].src/readers/error.rs: usesstd::ioerror types — same gate.src/dataset/mod.rs::serialize_data(lines 57–87): usesstd::fs::File— already gated#[cfg(not(target_arch = "wasm32"))]; change to#[cfg(feature = "std")].src/dataset/mod.rs::deserialize_data(lines 103–210): returnsio::Error— replace withFailedor a custom no-std error enum so the deserialization algorithm remains available on embedded.Notes
readers/is already behind#[cfg(feature = "serde")]; the newstdgate stacks on top.postcard(the serde backend) supportsno_std; verify nostd::iotypes leak through its API at the use sites.stdandno-stdpaths build.Acceptance
cargo build --no-default-featurescompiles without pulling instd::iocargo build --features "std,serde"still exposesreaders/anddatasetI/O as beforecargo test --all-featuresstill passesEstimated effort: ~2 hrs