Skip to main content

Module error

Module error 

Source
Expand description

Error types for RAR parsing and decompression.

This module provides the RarError type which covers all possible errors that can occur when parsing, decompressing, or decrypting RAR archives.

§Error Categories

CategoryErrorsDescription
FormatInvalidSignature, InvalidHeaderFile is not a valid RAR archive
EncryptionPasswordRequired, DecryptionFailedEncryption-related errors
DecompressionDecompressionNotSupportedUnsupported compression method
I/OIo, BufferTooSmallRead/write errors

§Example

use rar_stream::{RarFilesPackage, RarError};

match package.parse(opts).await {
    Ok(files) => println!("Found {} files", files.len()),
    Err(RarError::InvalidSignature) => eprintln!("Not a RAR file"),
    Err(RarError::PasswordRequired) => eprintln!("Archive is encrypted"),
    Err(e) => eprintln!("Error: {}", e),
}

Enums§

RarError
Error type for RAR operations.

Type Aliases§

Result