Available on crate feature
compression only.Expand description
Transparent gzip / zstd compression wrappers for file-shaped connectors.
Behind the compression feature. Exposes:
CompressionConfig— user-facing enum (None,Gzip,Zstd,Auto).Compression— internal post-resolution enum (noAuto).wrap_async_reader/wrap_async_writer— forstream_pagesand async sinks.wrap_sync_reader/wrap_sync_writer— forspawn_blockingpaths.compress_buf— one-shot in-memory compression for S3/GCS sink uploads.warn_mismatch— log-once helper when explicit codec disagrees with the filename extension.
Enums§
- Compression
- Internal post-resolution codec. No
Autovariant — callCompressionConfig::resolve. - Compression
Config - User-facing compression config. Defaults to
Auto. - Sync
Compress Writer - A sync compressing writer that retains the concrete encoder so its
finalisation error can be captured, unlike the
Box<dyn Write>returned bywrap_sync_writer(#78/#41).
Functions§
- compress_
buf - One-shot in-memory compression. Used by S3 and GCS sinks that build a full
Vec<u8>body before upload. - detect_
from_ path - Codec detection by filename suffix. Case-insensitive. Looks at the final
extension only:
foo.csv.gz→ Gzip,foo.gz.zst→ Zstd. - sync_
compress_ writer - Wrap a sync writer in a
SyncCompressWriterfor the given codec. Prefer this overwrap_sync_writerwhen you need to detect a finalisation error: callSyncCompressWriter::finishbefore dropping. - warn_
mismatch - Log a one-shot warning when the explicit codec disagrees with the
filename’s detected codec. Deduplicates per
(path, declared)pair across the whole process so a million-object scan does not flood logs. - wrap_
async_ reader - Wrap an async buffered reader with a streaming decoder.
Nonepasses through. - wrap_
async_ writer - Wrap an async writer with a streaming encoder.
Nonepasses through. Callers must calltokio::io::AsyncWriteExt::shutdownon the returned writer to flush the trailer before the underlying writer is dropped. - wrap_
sync_ reader - Wrap a sync reader with a streaming decoder.
Nonepasses through. - wrap_
sync_ writer - Wrap a sync writer with a streaming encoder.
Nonepasses through.