#[non_exhaustive]pub enum LimitExceeded {
Width {
actual: u32,
max: u32,
},
Height {
actual: u32,
max: u32,
},
Pixels {
actual: u64,
max: u64,
},
Memory {
actual: u64,
max: u64,
},
InputSize {
actual: u64,
max: u64,
},
OutputSize {
actual: u64,
max: u64,
},
Frames {
actual: u32,
max: u32,
},
Duration {
actual: u64,
max: u64,
},
TotalPixels {
actual: u64,
max: u64,
},
}Expand description
A resource limit was exceeded.
Returned by ResourceLimits::check_dimensions() and related methods.
Each variant carries the actual value and the limit that was exceeded,
enabling useful error messages.
Implements core::error::Error so codecs can wrap it in their own
error types.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Width
Image width exceeded max_width.
Height
Image height exceeded max_height.
Pixels
Pixel count exceeded max_pixels.
Memory
Memory exceeded max_memory_bytes.
InputSize
Input data size exceeded max_input_bytes.
OutputSize
Encoded output exceeded max_output_bytes.
Frames
Frame count exceeded max_frames.
Duration
Animation duration exceeded max_animation_ms.
TotalPixels
Total pixels across all frames exceeded max_total_pixels.
Implementations§
Source§impl LimitExceeded
impl LimitExceeded
Sourcepub fn kind(&self) -> LimitKind
pub fn kind(&self) -> LimitKind
Which cap was exceeded, without the actual/max values — for coarse
routing via ErrorCategory.
Trait Implementations§
Source§impl CategorizedError for LimitExceeded
impl CategorizedError for LimitExceeded
Source§fn codec_name(&self) -> Option<&'static str>
fn codec_name(&self) -> Option<&'static str>
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
ErrorCategory.Source§impl Clone for LimitExceeded
impl Clone for LimitExceeded
Source§fn clone(&self) -> LimitExceeded
fn clone(&self) -> LimitExceeded
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LimitExceeded
impl Debug for LimitExceeded
Source§impl Display for LimitExceeded
impl Display for LimitExceeded
impl Eq for LimitExceeded
Source§impl Error for LimitExceeded
impl Error for LimitExceeded
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()
Source§impl PartialEq for LimitExceeded
impl PartialEq for LimitExceeded
impl StructuralPartialEq for LimitExceeded
Auto Trait Implementations§
impl Freeze for LimitExceeded
impl RefUnwindSafe for LimitExceeded
impl Send for LimitExceeded
impl Sync for LimitExceeded
impl Unpin for LimitExceeded
impl UnsafeUnpin for LimitExceeded
impl UnwindSafe for LimitExceeded
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<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>
UnsupportedOperation in this error’s cause chain.Source§fn limit_exceeded(&self) -> Option<&LimitExceeded>
fn limit_exceeded(&self) -> Option<&LimitExceeded>
LimitExceeded in this error’s cause chain.Source§fn codec_error(&self) -> Option<&CodecError>
fn codec_error(&self) -> Option<&CodecError>
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,
T in this error’s cause chain.Source§fn error_category(&self) -> Option<ErrorCategory>
fn error_category(&self) -> Option<ErrorCategory>
codec_error().map(CodecError::category) — the
coarse axis app/lib code routes on.