Error

Enum Error 

Source
pub enum Error {
Show 28 variants Io(Error), InvalidFormat(String), UnsupportedVersion(u16), FileNotFound(String), FileExists(String), HashTable(String), BlockTable(String), Crypto(String), Compression(String), SignatureVerification(String), InvalidHeader(String), ReadOnly, OperationNotSupported { version: u16, operation: String, }, InvalidFileSize { expected: u64, actual: u64, }, MemoryMap(String), InvalidUtf8, CapacityExceeded(String), ChecksumMismatch { file: String, expected: u32, actual: u32, }, MD5Mismatch { table: String, }, NotImplemented(&'static str), SecurityViolation(String), MaliciousContent(String), ResourceExhaustion(String), DirectoryTraversal(String), CompressionBomb { ratio: u64, limit: u64, }, InvalidBounds(String), UnsupportedFeature(String), Decompression(String),
}
Expand description

Main error type for MPQ operations

Variants§

§

Io(Error)

I/O error occurred

§

InvalidFormat(String)

Invalid MPQ format or corrupted archive

§

UnsupportedVersion(u16)

Unsupported MPQ version

§

FileNotFound(String)

File not found in archive

§

FileExists(String)

File already exists in archive

§

HashTable(String)

Hash table error

§

BlockTable(String)

Block table error

§

Crypto(String)

Encryption/decryption error

§

Compression(String)

Compression/decompression error

§

SignatureVerification(String)

Signature verification failed

§

InvalidHeader(String)

Invalid header location or alignment

§

ReadOnly

Archive is read-only

§

OperationNotSupported

Operation not supported for this archive version

Fields

§version: u16

The MPQ version

§operation: String

The unsupported operation

§

InvalidFileSize

Invalid file size

Fields

§expected: u64

Expected size

§actual: u64

Actual size

§

MemoryMap(String)

Memory mapping error

§

InvalidUtf8

Invalid UTF-8 in filename

§

CapacityExceeded(String)

Archive capacity exceeded

§

ChecksumMismatch

Checksum mismatch

Fields

§file: String

File or table name

§expected: u32

Expected checksum

§actual: u32

Actual checksum

§

MD5Mismatch

MD5 hash mismatch (v4 archives)

Fields

§table: String

Table name

§

NotImplemented(&'static str)

Feature not yet implemented

§

SecurityViolation(String)

Security validation failed

§

MaliciousContent(String)

Potential malicious content detected

§

ResourceExhaustion(String)

Resource exhaustion attempt detected

§

DirectoryTraversal(String)

Directory traversal attempt detected

§

CompressionBomb

Compression bomb detected

Fields

§ratio: u64

Actual compression ratio

§limit: u64

Maximum allowed ratio

§

InvalidBounds(String)

Invalid bounds access

§

UnsupportedFeature(String)

Unsupported feature

§

Decompression(String)

Decompression error

Implementations§

Source§

impl Error

Source

pub fn invalid_format<S: Into<String>>(msg: S) -> Self

Create a new InvalidFormat error

Source

pub fn crypto<S: Into<String>>(msg: S) -> Self

Create a new Crypto error

Source

pub fn compression<S: Into<String>>(msg: S) -> Self

Create a new Compression error

Source

pub fn hash_table<S: Into<String>>(msg: S) -> Self

Create a new HashTable error

Source

pub fn block_table<S: Into<String>>(msg: S) -> Self

Create a new BlockTable error

Source

pub fn security_violation<S: Into<String>>(msg: S) -> Self

Create a new SecurityViolation error

Source

pub fn malicious_content<S: Into<String>>(msg: S) -> Self

Create a new MaliciousContent error

Source

pub fn resource_exhaustion<S: Into<String>>(msg: S) -> Self

Create a new ResourceExhaustion error

Source

pub fn directory_traversal<S: Into<String>>(msg: S) -> Self

Create a new DirectoryTraversal error

Source

pub fn compression_bomb(ratio: u64, limit: u64) -> Self

Create a new CompressionBomb error

Source

pub fn invalid_bounds<S: Into<String>>(msg: S) -> Self

Create a new InvalidBounds error

Source

pub fn unsupported_feature<S: Into<String>>(msg: S) -> Self

Create a new UnsupportedFeature error

Source

pub fn io_error<S: Into<String>>(msg: S) -> Self

Create a new I/O error

Source

pub fn decompression<S: Into<String>>(msg: S) -> Self

Create a new Decompression error

Source

pub fn is_corruption(&self) -> bool

Check if this error indicates the archive is corrupted

Source

pub fn is_security_threat(&self) -> bool

Check if this error indicates a security threat

Source

pub fn is_recoverable(&self) -> bool

Check if this error is recoverable

Trait Implementations§

Source§

impl Debug for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for Error

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for Error

Source§

fn from(source: Error) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl Freeze for Error

§

impl !RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl !UnwindSafe for Error

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V