pub enum Error {
InvalidArgument(String),
Codec(String),
Unsupported(String),
}Expand description
Why compressing, decompressing or configuring an algorithm failed.
PHP: one variant per way utopia-php/compression fails (see
Error::php_class).
Variants§
InvalidArgument(String)
An argument out of range, such as a compression level.
PHP: \InvalidArgumentException, thrown by setLevel().
Codec(String)
The codec refused the input: data that is not a valid stream of the
algorithm, or a level the codec does not accept. The message is the
warning PHP’s extension emits, such as gzinflate(): data error.
PHP: no exception. The extension emits an E_WARNING with this
message and returns false, which the method’s string return type
coerces to an empty string.
Unsupported(String)
The algorithm was built without the cargo feature that provides it.
The message names the missing function, such as
Call to undefined function Utopia\Compression\Algorithms\xzencode().
PHP: \Error, thrown when the extension is not loaded.
Implementations§
Source§impl Error
impl Error
Sourcepub fn php_class(&self) -> &'static str
pub fn php_class(&self) -> &'static str
The name of the PHP class this error matches, such as
InvalidArgumentException.
PHP: the class of the exception utopia-php/compression throws in the
same case. Error::Codec is a warning in PHP, not an exception; it
reports ErrorException, the class an error handler that turns
warnings into exceptions throws.
Trait Implementations§
impl Eq for Error
Source§impl Error for Error
impl Error for Error
1.30.0 · 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
use the Display impl or to_string()
impl StructuralPartialEq for Error
Auto Trait Implementations§
impl Forget for Error
impl Freeze for Error
impl Move for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.