Expand description
Shared subprocess + file-IO primitives for the file-driven codec adapters.
The generic external-codec adapter (crate::adapters_external, which
drives any conformant codec via the file-based CLI contract of
SPEC/OpenECS-v1.0.md §6) — and any vendor adapter that shells out to a
specific codec binary — need the same handful of building blocks:
ScratchDir— a uniquely-named temp directory removed on drop, so concurrent encode/decode calls never collide and cleanup is oneremove_dir_all.write_edf_bytes— render a per-channel integer signal as a minimal, spec-valid EDF byte image (the default encode-input format).reshape_channel_major— split a flat little-endian integer stream (the default decode-output format) into oneVec<i64>per channel, validating the byte length against the declared shape first.SampleDtype— the integer width of the raw decode stream.
This module is pure std (no new dependencies beyond serde for the
small SampleDtype enum, which the manifest layer deserializes). It
is not on the grading hot path — the metric/grade core stays
dependency-light.
Structs§
- Scratch
Dir - A scratch directory under the system temp dir, removed on drop.
Enums§
- Sample
Dtype - Integer width of the raw, channel-major decode stream a conformant
codec writes (and that
reshape_channel_majorreads back).
Functions§
- reshape_
channel_ major - Split a flat little-endian, channel-major integer stream into one
Vec<i64>per channel. - write_
edf_ bytes - Build a minimal, spec-valid EDF byte image for
signalat ratefs.