Skip to content

Commit

Permalink
Bump zstd-safe to 7.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gyscos committed Mar 27, 2024
1 parent 55f5b7b commit 3ca5f62
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
4 changes: 2 additions & 2 deletions zstd-safe/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
authors = ["Alexandre Bury <alexandre.bury@gmail.com>"]
name = "zstd-safe"
build = "build.rs"
version = "7.0.0"
version = "7.1.0"
description = "Safe low-level bindings for the zstd compression library."
keywords = ["zstd", "zstandard", "compression"]
categories = ["api-bindings", "compression"]
Expand All @@ -17,7 +17,7 @@ exclude = ["update_consts.sh"]
features = ["experimental", "arrays", "std", "zdict_builder", "doc-cfg"]

[dependencies]
zstd-sys = { path = "zstd-sys", version = "2.0.7", default-features = false }
zstd-sys = { path = "zstd-sys", version = "2.0.10", default-features = false }

[features]
default = ["legacy", "arrays", "zdict_builder"]
Expand Down
23 changes: 14 additions & 9 deletions zstd-safe/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,6 @@ impl<'a> CCtx<'a> {
ZSTD_c_experimentalParam3 as ZSTD_c_forceMaxWindow,
ZSTD_c_experimentalParam4 as ZSTD_c_forceAttachDict,
ZSTD_c_experimentalParam5 as ZSTD_c_literalCompressionMode,
ZSTD_c_experimentalParam6 as ZSTD_c_targetCBlockSize,
ZSTD_c_experimentalParam7 as ZSTD_c_srcSizeHint,
ZSTD_c_experimentalParam8 as ZSTD_c_enableDedicatedDictSearch,
ZSTD_c_experimentalParam9 as ZSTD_c_stableInBuffer,
Expand All @@ -633,10 +632,6 @@ impl<'a> CCtx<'a> {
(ZSTD_c_literalCompressionMode, mode as c_int)
}
#[cfg(feature = "experimental")]
TargetCBlockSize(value) => {
(ZSTD_c_targetCBlockSize, value as c_int)
}
#[cfg(feature = "experimental")]
SrcSizeHint(value) => (ZSTD_c_srcSizeHint, value as c_int),
#[cfg(feature = "experimental")]
EnableDedicatedDictSearch(enable) => {
Expand Down Expand Up @@ -680,6 +675,9 @@ impl<'a> CCtx<'a> {
SearchForExternalRepcodes(value) => {
(ZSTD_c_searchForExternalRepcodes, value as c_int)
}
TargetCBlockSize(value) => {
(ZSTD_c_targetCBlockSize, value as c_int)
}
CompressionLevel(level) => (ZSTD_c_compressionLevel, level),
WindowLog(value) => (ZSTD_c_windowLog, value as c_int),
HashLog(value) => (ZSTD_c_hashLog, value as c_int),
Expand Down Expand Up @@ -1997,6 +1995,7 @@ pub enum ParamSwitch {

/// A compression parameter.
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[non_exhaustive]
pub enum CParameter {
#[cfg(feature = "experimental")]
#[cfg_attr(feature = "doc-cfg", doc(cfg(feature = "experimental")))]
Expand All @@ -2018,10 +2017,6 @@ pub enum CParameter {
#[cfg_attr(feature = "doc-cfg", doc(cfg(feature = "experimental")))]
LiteralCompressionMode(ParamSwitch),

#[cfg(feature = "experimental")]
#[cfg_attr(feature = "doc-cfg", doc(cfg(feature = "experimental")))]
TargetCBlockSize(u32),

#[cfg(feature = "experimental")]
#[cfg_attr(feature = "doc-cfg", doc(cfg(feature = "experimental")))]
SrcSizeHint(u32),
Expand Down Expand Up @@ -2074,6 +2069,14 @@ pub enum CParameter {
#[cfg_attr(feature = "doc-cfg", doc(cfg(feature = "experimental")))]
SearchForExternalRepcodes(ParamSwitch),

/// Target CBlock size.
///
/// Tries to make compressed blocks fit in this size (not a guarantee, just a target).
/// Useful to reduce end-to-end latency in low-bandwidth environments.
///
/// No target when the value is 0.
TargetCBlockSize(u32),

/// Compression level to use.
///
/// Compression levels are global presets for the other compression parameters.
Expand Down Expand Up @@ -2146,6 +2149,8 @@ pub enum CParameter {
}

/// A decompression parameter.
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[non_exhaustive]
pub enum DParameter {
WindowLogMax(u32),

Expand Down

0 comments on commit 3ca5f62

Please sign in to comment.