You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my project I compress blocks of known size into buffers with the same block size. If data is not compressible (should not happen in practice, but still theoretically possible), then there is a separate fallback path in which block data is stored without any compression.
Right now, I have to use compress2 from zstd_safe with manual matching of error code on 70 (value of ZSTD_error_dstSize_tooSmall taken from zstd_errors.h). At the very least, it would be nice to expose the error constant (and maybe the other error codes as well for consistency) in zstd_safe and ideally it would be great to be able to efficiently detect "destination buffer is too small" case in the bulk API. For example, it could be done by introducing a method which returns io::Result<Option<usize>>, with Ok(None) used for the "too small" case.
The text was updated successfully, but these errors were encountered:
In my project I compress blocks of known size into buffers with the same block size. If data is not compressible (should not happen in practice, but still theoretically possible), then there is a separate fallback path in which block data is stored without any compression.
Right now, I have to use
compress2
fromzstd_safe
with manual matching of error code on 70 (value ofZSTD_error_dstSize_tooSmall
taken fromzstd_errors.h
). At the very least, it would be nice to expose the error constant (and maybe the other error codes as well for consistency) inzstd_safe
and ideally it would be great to be able to efficiently detect "destination buffer is too small" case in the bulk API. For example, it could be done by introducing a method which returnsio::Result<Option<usize>>
, withOk(None)
used for the "too small" case.The text was updated successfully, but these errors were encountered: