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
InvalidFileSize
Invalid file size
MemoryMap(String)
Memory mapping error
InvalidUtf8
Invalid UTF-8 in filename
CapacityExceeded(String)
Archive capacity exceeded
ChecksumMismatch
Checksum mismatch
MD5Mismatch
MD5 hash mismatch (v4 archives)
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
InvalidBounds(String)
Invalid bounds access
UnsupportedFeature(String)
Unsupported feature
Decompression(String)
Decompression error
Implementations§
Source§impl Error
impl Error
Sourcepub fn invalid_format<S: Into<String>>(msg: S) -> Self
pub fn invalid_format<S: Into<String>>(msg: S) -> Self
Create a new InvalidFormat error
Sourcepub fn compression<S: Into<String>>(msg: S) -> Self
pub fn compression<S: Into<String>>(msg: S) -> Self
Create a new Compression error
Sourcepub fn hash_table<S: Into<String>>(msg: S) -> Self
pub fn hash_table<S: Into<String>>(msg: S) -> Self
Create a new HashTable error
Sourcepub fn block_table<S: Into<String>>(msg: S) -> Self
pub fn block_table<S: Into<String>>(msg: S) -> Self
Create a new BlockTable error
Sourcepub fn security_violation<S: Into<String>>(msg: S) -> Self
pub fn security_violation<S: Into<String>>(msg: S) -> Self
Create a new SecurityViolation error
Sourcepub fn malicious_content<S: Into<String>>(msg: S) -> Self
pub fn malicious_content<S: Into<String>>(msg: S) -> Self
Create a new MaliciousContent error
Sourcepub fn resource_exhaustion<S: Into<String>>(msg: S) -> Self
pub fn resource_exhaustion<S: Into<String>>(msg: S) -> Self
Create a new ResourceExhaustion error
Sourcepub fn directory_traversal<S: Into<String>>(msg: S) -> Self
pub fn directory_traversal<S: Into<String>>(msg: S) -> Self
Create a new DirectoryTraversal error
Sourcepub fn compression_bomb(ratio: u64, limit: u64) -> Self
pub fn compression_bomb(ratio: u64, limit: u64) -> Self
Create a new CompressionBomb error
Sourcepub fn invalid_bounds<S: Into<String>>(msg: S) -> Self
pub fn invalid_bounds<S: Into<String>>(msg: S) -> Self
Create a new InvalidBounds error
Sourcepub fn unsupported_feature<S: Into<String>>(msg: S) -> Self
pub fn unsupported_feature<S: Into<String>>(msg: S) -> Self
Create a new UnsupportedFeature error
Sourcepub fn decompression<S: Into<String>>(msg: S) -> Self
pub fn decompression<S: Into<String>>(msg: S) -> Self
Create a new Decompression error
Sourcepub fn is_corruption(&self) -> bool
pub fn is_corruption(&self) -> bool
Check if this error indicates the archive is corrupted
Sourcepub fn is_security_threat(&self) -> bool
pub fn is_security_threat(&self) -> bool
Check if this error indicates a security threat
Sourcepub fn is_recoverable(&self) -> bool
pub fn is_recoverable(&self) -> bool
Check if this error is recoverable
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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