Cargo Features
[dependencies]
gzp = { version = "2.0.2", default-features = false, features = ["snappy_default", "deflate_default", "deflate_rust", "deflate_zlib", "deflate_zlib_ng", "deflate", "libdeflate", "snappy", "any_zlib"] }
- default = deflate_default, libdeflate
-
Feature Sets
- snappy_default = deflate_rust, snap, snappy
-
needs flate2 for compression type
- deflate_default default = deflate_zlib_ng
- deflate_rust snappy_default? = deflate
-
Enables rust_backend of flate2
flate2:
User-Facing Backend Features
Choose one of these features to select the compression backend. Only one backend should be enabled at a time, or else one will see an unstable order which is currently
zlib-ng,zlib-rs,cloudflare_zlib,miniz_oxideand which may change at any time.Use the pure Rust
miniz_oxidebackend (default). This implementation uses only safe Rust code and doesn't require a C compiler. It provides good performance for most use cases while being completely portable.Note that this feature at some point may be switched to use
zlib-rsinstead. - deflate_zlib = any_zlib, deflate, libz-sys
-
Enables libc of libz-sys and zlib of flate2
flate2:
Use the system's installed zlib library.
This is useful when you need compatibility with other C code that uses zlib,
or when you want to use the system-provided zlib for consistency. - deflate_zlib_ng deflate_default = any_zlib, deflate, libz-ng-sys
-
flate2:
Use the high-performance zlib-ng library directly.
This typically provides better performance than stock zlib and works even when other dependencies use zlib. Requires a C compiler. - deflate deflate_rust? deflate_zlib? deflate_zlib_ng?
-
Feature flags used internally
Affects
check::Crc32,gzp::deflate… - libdeflate default = libdeflater
-
Affects
bgzf::decompress,bgzf::compress,check::LibDeflateCrc,mgzip::decompress,mgzip::compress… - snappy snappy_default?
-
Affects
gzp::snap… - any_zlib deflate_zlib? deflate_zlib_ng?
-
flate2:
Internal Features
These features are used internally for backend selection and should not be enabled directly by users. They are documented here to aid with maintenance.
Internal: Marker feature indicating that any zlib-based C backend is enabled. This is automatically enabled by
zlib-rs,zlib,zlib-ng,zlib-ng-compat, andcloudflare_zlib. Do not enable this feature directly; instead, choose a specific backend feature.Affects
check::Adler32,deflate::Zlib…
Features from optional dependencies
In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.