Struct gif::MemoryLimit
source · pub struct MemoryLimit(pub u32);
Expand description
StreamingDecoder configuration parameters
Memory limit in bytes. MemoryLimit(0)
means
that there is no memory limit set.
Tuple Fields§
§0: u32
Implementations§
source§impl MemoryLimit
impl MemoryLimit
sourcepub const NONE: MemoryLimit = _
pub const NONE: MemoryLimit = _
Enforce no memory limit.
If you intend to process images from unknown origins this is a potentially dangerous constant to use, as your program could be vulnerable to decompression bombs. That is, malicious images crafted specifically to require an enormous amount of memory to process while having a disproportionately small file size.
The risks for modern machines are a bit smaller as the dimensions of each frame can not
exceed u32::MAX
(~4Gb) but this is still a significant amount of memory.
Trait Implementations§
source§impl Clone for MemoryLimit
impl Clone for MemoryLimit
source§fn clone(&self) -> MemoryLimit
fn clone(&self) -> MemoryLimit
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for MemoryLimit
impl RefUnwindSafe for MemoryLimit
impl Send for MemoryLimit
impl Sync for MemoryLimit
impl Unpin for MemoryLimit
impl UnwindSafe for MemoryLimit
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)