Struct gif::MemoryLimit
source · [−]pub struct MemoryLimit(pub u32);
Expand description
Memory limit in bytes. MemoryLimit(0)
means
that there is no memory limit set.
Tuple Fields
0: u32
Implementations
sourceimpl MemoryLimit
impl MemoryLimit
sourcepub const NONE: MemoryLimit = MemoryLimit(0)
pub const NONE: MemoryLimit = MemoryLimit(0)
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
sourceimpl Clone for MemoryLimit
impl Clone for MemoryLimit
sourcefn clone(&self) -> MemoryLimit
fn clone(&self) -> MemoryLimit
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for MemoryLimit
impl Send for MemoryLimit
impl Sync for MemoryLimit
impl Unpin for MemoryLimit
impl UnwindSafe for MemoryLimit
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more