pub struct ResourceLimits {
pub max_memory_bytes: u64,
pub max_file_descriptors: u64,
pub max_processes: u64,
pub execution_timeout: Duration,
}Expand description
Resource limits for DOS attack prevention
Enforces strict limits on resources that can be consumed during analysis:
- Memory usage (prevents memory exhaustion)
- File descriptors (prevents FD exhaustion)
- Process count (prevents fork bombs)
- Execution timeout (prevents infinite loops)
Fields§
§max_memory_bytes: u64Maximum memory usage in bytes (default: 500MB)
max_file_descriptors: u64Maximum number of file descriptors (default: 1024)
max_processes: u64Maximum number of processes (default: 100)
execution_timeout: DurationMaximum execution time (default: 300s)
Implementations§
Source§impl ResourceLimits
impl ResourceLimits
Sourcepub fn new(
max_memory_bytes: u64,
max_file_descriptors: u64,
max_processes: u64,
execution_timeout: Duration,
) -> Self
pub fn new( max_memory_bytes: u64, max_file_descriptors: u64, max_processes: u64, execution_timeout: Duration, ) -> Self
Create new resource limits with custom values
Trait Implementations§
Source§impl Clone for ResourceLimits
impl Clone for ResourceLimits
Source§fn clone(&self) -> ResourceLimits
fn clone(&self) -> ResourceLimits
Returns a duplicate 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 moreSource§impl Debug for ResourceLimits
impl Debug for ResourceLimits
Auto Trait Implementations§
impl Freeze for ResourceLimits
impl RefUnwindSafe for ResourceLimits
impl Send for ResourceLimits
impl Sync for ResourceLimits
impl Unpin for ResourceLimits
impl UnwindSafe for ResourceLimits
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§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more