Skip to main content

Crate s4_codec

Crate s4_codec 

Source
Expand description

Python bindings for s4-codec (v0.4 #23).

Exposes the CPU codecs (CpuZstd, CpuGzip) and a gpu_available() helper. GPU codec classes (NvcompZstd, NvcompBitcomp, NvcompGDeflate) are gated behind the nvcomp-gpu cargo feature so the default pip install s4-codec wheel doesn’t require a CUDA toolchain at build time. Build with maturin build --release --features nvcomp-gpu on a machine with NVCOMP_HOME set to opt in.

§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
S4IoError
S4ManifestSizeExceedsLimitError
S4ManifestSizeMismatchError
S4SizeMismatchError
S4UnregisteredCodecError