Enum xz_embedded_sys::xz_ret [] [src]

#[repr(C)]
pub enum xz_ret { XZ_OK, XZ_STREAM_END, XZ_UNSUPPORTED_CHECK, XZ_MEM_ERROR, XZ_MEMLIMIT_ERROR, XZ_FORMAT_ERROR, XZ_OPTIONS_ERROR, XZ_DATA_ERROR, XZ_BUF_ERROR, }

Return codes

In multi-call mode, XZ_BUF_ERROR is returned when two consecutive calls to XZ code cannot consume any input and cannot produce any new output. This happens when there is no new input available, or the output buffer is full while at least one output byte is still pending. Assuming your code is not buggy, you can get this error only when decoding a compressed stream that is truncated or otherwise corrupt.

In single-call mode, XZ_BUF_ERROR is returned only when the output buffer is too small or the compressed input is corrupt in a way that makes the decoder produce more output than the caller expected. When it is (relatively) clear that the compressed input is truncated, XZ_DATA_ERROR is used instead of XZ_BUF_ERROR.

Variants

Everything is OK so far. More input or more output space is required to continue. This return code is possible only in multi-call mode (XZ_PREALLOC or XZ_DYNALLOC).

Operation finished successfully.

Integrity check type is not supported. Decoding is still possible in multi-call mode by simply calling xz_dec_run() again. Note that this return value is used only if XZ_DEC_ANY_CHECK was defined at build time, which is not used in the kernel. Unsupported check types return XZ_OPTIONS_ERROR if XZ_DEC_ANY_CHECK was not defined at build time.

Allocating memory failed. This return code is possible only if the decoder was initialized with XZ_DYNALLOC. The amount of memory that was tried to be allocated was no more than the dict_max argument given to xz_dec_init().

A bigger LZMA2 dictionary would be needed than allowed by the dict_max argument given to xz_dec_init(). This return value is possible only in multi-call mode (XZ_PREALLOC or XZ_DYNALLOC); the single-call mode (XZ_SINGLE) ignores the dict_max argument.

File format was not recognized (wrong magic bytes).

This implementation doesn't support the requested compression options. In the decoder this means that the header CRC32 matches, but the header itself specifies something that we don't support.

Compressed data is corrupt.

Cannot make any progress. Details are slightly different between multi-call and single-call mode; more information below.

Trait Implementations

impl Debug for xz_ret
[src]

Formats the value using the given formatter.

impl Clone for xz_ret
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for xz_ret
[src]

impl PartialEq for xz_ret
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.