Expand description
WHATWG CompressionStream / DecompressionStream.
Both are “generic transform streams”: not TransformStream
subclasses, but objects exposing the readable / writable pair of
one. This builds a real TransformStream (the vendored class in
crate::stream_web) whose transform and flush are
native functions, so backpressure, cancellation and pipeThrough
all come from the spec-exact stream machinery rather than being
reimplemented here.
The spec defines exactly three formats — gzip, deflate (zlib
wrapper) and deflate-raw — all of which flate2 covers. Brotli and
zstd are deliberately absent: they are not in the Compression Streams
spec, and accepting them would be a silent extension callers could
not rely on elsewhere.
The native closures capture only an Arc<Mutex<..>> of Rust state,
never a JS value, per the GC-cycle discipline.
Structs§
- Compression
Stream Js - WHATWG
CompressionStream. - Decompression
Stream Js - WHATWG
DecompressionStream.