Skip to main content

Crate s4_codec

Crate s4_codec 

Source
Expand description

Python bindings for s4-codec.

Exposes the CPU codecs (CpuZstd, CpuGzip) and a gpu_available() helper. GPU codec classes are intentionally NOT exposed in v1.0 — the nvcomp-gpu cargo feature on this crate forwards to the underlying s4-codec GPU paths for the server build, but the Python module’s runtime classes remain CPU-only. See crates/s4-codec-py/README.md for the rationale; GPU-Python exposure is a v1.x roadmap candidate.

§Async bridge

s4_codec_rs::Codec is async. Python callers expect blocking calls. We resolve this by running each call on a process-wide multi-thread tokio runtime stashed in a OnceLock. Python::allow_threads releases the GIL across the await so other Python threads can progress while the blocking compression worker churns.

Structs§

S4BackendError
S4CodecMismatchError
S4CrcMismatchError
S4Error
S4FrameError
S4IndexError
S4IoError
S4ManifestSizeExceedsLimitError
S4ManifestSizeMismatchError
S4SizeMismatchError
S4UnregisteredCodecError