Skip to content

no-std Step 2: gate readers/ and dataset I/O behind #[cfg(feature = "std")] #415

Description

@Mec-iS

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

  • cargo build --no-default-features compiles without pulling in std::io
  • cargo build --features "std,serde" still exposes readers/ and dataset I/O as before
  • cargo test --all-features still passes

Estimated effort: ~2 hrs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions