pub enum CompressionError {
CompressionFailed(String),
DecompressionFailed(String),
InvalidInput(String),
UnsupportedAlgorithm(String),
Io(Error),
ZstdError(String),
BrotliError(String),
Other(Error),
}Expand description
Errors that can occur during compression operations
Variants§
CompressionFailed(String)
Compression operation failed
DecompressionFailed(String)
Decompression operation failed
InvalidInput(String)
Invalid input data
UnsupportedAlgorithm(String)
Unsupported compression algorithm
Io(Error)
I/O error occurred
ZstdError(String)
Zstd-specific error
BrotliError(String)
Brotli-specific error
Other(Error)
Generic error for opaque error types
Implementations§
Source§impl CompressionError
impl CompressionError
Sourcepub fn compression_failed<S: Into<String>>(msg: S) -> Self
pub fn compression_failed<S: Into<String>>(msg: S) -> Self
Create a compression failed error
Sourcepub fn decompression_failed<S: Into<String>>(msg: S) -> Self
pub fn decompression_failed<S: Into<String>>(msg: S) -> Self
Create a decompression failed error
Sourcepub fn invalid_input<S: Into<String>>(msg: S) -> Self
pub fn invalid_input<S: Into<String>>(msg: S) -> Self
Create an invalid input error
Sourcepub fn unsupported_algorithm<S: Into<String>>(algorithm: S) -> Self
pub fn unsupported_algorithm<S: Into<String>>(algorithm: S) -> Self
Create an unsupported algorithm error
Sourcepub fn zstd_error<S: Into<String>>(msg: S) -> Self
pub fn zstd_error<S: Into<String>>(msg: S) -> Self
Create a zstd-specific error
Sourcepub fn brotli_error<S: Into<String>>(msg: S) -> Self
pub fn brotli_error<S: Into<String>>(msg: S) -> Self
Create a brotli-specific error
Sourcepub fn is_compression_failed(&self) -> bool
pub fn is_compression_failed(&self) -> bool
Check if this is a compression failed error
Sourcepub fn is_decompression_failed(&self) -> bool
pub fn is_decompression_failed(&self) -> bool
Check if this is a decompression failed error
Trait Implementations§
Source§impl Debug for CompressionError
impl Debug for CompressionError
Source§impl Display for CompressionError
impl Display for CompressionError
Source§impl Error for CompressionError
impl Error for CompressionError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<Error> for CompressionError
impl From<Error> for CompressionError
Auto Trait Implementations§
impl !RefUnwindSafe for CompressionError
impl !UnwindSafe for CompressionError
impl Forget for CompressionError
impl Freeze for CompressionError
impl Send for CompressionError
impl Sync for CompressionError
impl Unpin for CompressionError
impl UnsafeUnpin for CompressionError
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
Mutably borrows from an owned value. Read more