#[non_exhaustive]pub enum UnsupportedOperation {
RowLevelEncode,
PullEncode,
AnimationEncode,
DecodeInto,
RowLevelDecode,
AnimationDecode,
PixelFormat,
MultiImageDecode,
GainMapEncode,
}Expand description
Identifies an operation that a codec does not support.
Codecs include this in their error types (e.g. as a variant payload)
so callers can generically detect “this codec doesn’t support this
operation” without downcasting. See CodecErrorExt.
§Example
use zencodec::UnsupportedOperation;
let op = UnsupportedOperation::DecodeInto;
assert_eq!(format!("{op}"), "unsupported operation: decode_into");Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
RowLevelEncode
Encoder::push_rows() + finish() (row-level encode).
PullEncode
Encoder::encode_from() (pull-from-source encode).
AnimationEncode
All AnimationFrameEncoder methods (animation encoding).
DecodeInto
Decoder::decode_into() (decode into caller buffer).
RowLevelDecode
Decoder::decode_rows() (row-level decode).
AnimationDecode
All AnimationFrameDecoder methods (animation decoding).
PixelFormat
A specific pixel format is not supported.
MultiImageDecode
All MultiPageDecoder methods (multi-image decode).
GainMapEncode
Gain-map embedding on encode
(with_gain_map_pixels /
with_gain_map_encoded).
Implementations§
Trait Implementations§
Source§impl CategorizedError for UnsupportedOperation
impl CategorizedError for UnsupportedOperation
Source§fn codec_name(&self) -> Option<&'static str>
fn codec_name(&self) -> Option<&'static str>
The originating codec’s name (e.g.
Some("zenjpeg")). A codec returns a
constant here on its error type so CodecError::from_native /
of can tag the envelope from the value — no separate
argument. Required: there is deliberately no default, so every
implementor must answer it. The zencodec cause types (LimitExceeded,
UnsupportedOperation, enough::StopReason) implement it as None
since they aren’t codecs. Read moreSource§fn category(&self) -> ErrorCategory
fn category(&self) -> ErrorCategory
This error’s coarse
ErrorCategory.Source§impl Clone for UnsupportedOperation
impl Clone for UnsupportedOperation
Source§fn clone(&self) -> UnsupportedOperation
fn clone(&self) -> UnsupportedOperation
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for UnsupportedOperation
Source§impl Debug for UnsupportedOperation
impl Debug for UnsupportedOperation
Source§impl Display for UnsupportedOperation
impl Display for UnsupportedOperation
impl Eq for UnsupportedOperation
Source§impl Error for UnsupportedOperation
impl Error for UnsupportedOperation
1.30.0 · 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 Hash for UnsupportedOperation
impl Hash for UnsupportedOperation
Source§impl PartialEq for UnsupportedOperation
impl PartialEq for UnsupportedOperation
impl StructuralPartialEq for UnsupportedOperation
Auto Trait Implementations§
impl Freeze for UnsupportedOperation
impl RefUnwindSafe for UnsupportedOperation
impl Send for UnsupportedOperation
impl Sync for UnsupportedOperation
impl Unpin for UnsupportedOperation
impl UnsafeUnpin for UnsupportedOperation
impl UnwindSafe for UnsupportedOperation
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<E> CodecErrorExt for Ewhere
E: Error + 'static,
impl<E> CodecErrorExt for Ewhere
E: Error + 'static,
Source§fn unsupported_operation(&self) -> Option<&UnsupportedOperation>
fn unsupported_operation(&self) -> Option<&UnsupportedOperation>
Find an
UnsupportedOperation in this error’s cause chain.Source§fn limit_exceeded(&self) -> Option<&LimitExceeded>
fn limit_exceeded(&self) -> Option<&LimitExceeded>
Find a
LimitExceeded in this error’s cause chain.Source§fn codec_error(&self) -> Option<&CodecError>
fn codec_error(&self) -> Option<&CodecError>
Recover the shared
CodecError envelope from this error’s chain — after
any erasure (Box<dyn Error>, anyhow::Error, a mapped wrapper) — by
downcasting to the concrete At<CodecError> (or a bare CodecError),
tolerating a single Box layer (Box<At<CodecError>> etc., so a codec may
use an 8-byte boxed type Error). It gives the
category and the originating
codec name, so a consumer can tell codecs apart
without naming any codec-specific type. Read moreSource§fn find_cause<T>(&self) -> Option<&T>where
T: Error + 'static,
fn find_cause<T>(&self) -> Option<&T>where
T: Error + 'static,
Find a cause of arbitrary type
T in this error’s cause chain.Source§fn error_category(&self) -> Option<ErrorCategory>
fn error_category(&self) -> Option<ErrorCategory>
Shortcut for
codec_error().map(CodecError::category) — the
coarse axis app/lib code routes on.