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
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
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 · sourcepub fn borrow_mut(&mut self) -> &mut T
pub 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.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more