pub struct DecodeLimits {
pub max_input_bytes: usize,
pub max_canvas_pixels: u64,
pub max_frame_count: u32,
pub max_total_duration: Duration,
pub max_frame_rgba_bytes: usize,
}Expand description
Per-animation limits applied before and while decoding.
The Default values are intended for ordinary untrusted inputs. Use
Self::for_trusted_input only when the caller has already established an
appropriate process-wide memory and workload policy.
Fields§
§max_input_bytes: usizeMaximum number of input bytes accepted by AnimationDecoder::new.
max_canvas_pixels: u64Maximum number of pixels in the decoded animation canvas.
max_frame_count: u32Maximum number of frames in the stored animation sequence.
max_total_duration: DurationMaximum sum of source frame durations observed while decoding.
max_frame_rgba_bytes: usizeMaximum number of bytes in one full-canvas RGBA frame.
Implementations§
Source§impl DecodeLimits
impl DecodeLimits
Sourcepub const fn for_trusted_input() -> Self
pub const fn for_trusted_input() -> Self
Relaxes crate-level resource limits for trusted input.
This does not bypass libwebp or platform allocation limits.
Trait Implementations§
Source§impl Clone for DecodeLimits
impl Clone for DecodeLimits
Source§fn clone(&self) -> DecodeLimits
fn clone(&self) -> DecodeLimits
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 moreSource§impl Debug for DecodeLimits
impl Debug for DecodeLimits
Auto Trait Implementations§
impl Freeze for DecodeLimits
impl RefUnwindSafe for DecodeLimits
impl Send for DecodeLimits
impl Sync for DecodeLimits
impl Unpin for DecodeLimits
impl UnsafeUnpin for DecodeLimits
impl UnwindSafe for DecodeLimits
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