Documentation Index
Fetch the complete documentation index at: https://docs.praison.ai/llms.txt
Use this file to discover all available pages before exploring further.
ResourceLimits
Defined in the sandbox module.
Rust AI Agent SDK
Resource limits for sandbox execution.
Fields
| Name | Type | Description |
|---|
memory_mb | u32 | Maximum memory in megabytes (0 = unlimited) |
cpu_percent | u32 | Maximum CPU percentage (0 = unlimited) |
timeout_seconds | u32 | Maximum execution time in seconds |
max_processes | u32 | Maximum number of processes |
max_open_files | u32 | Maximum number of open files |
network_enabled | bool | Whether network access is allowed |
disk_write_mb | u32 | Maximum disk write in megabytes (0 = unlimited) |
Methods
new
Create default resource limits.
minimal
Create minimal resource limits for untrusted code.
standard
Create standard resource limits.
generous
Create generous resource limits for trusted code.
memory_mb
fn memory_mb(mut self, mb: u32) -> Self
Set memory limit.
Parameters:
cpu_percent
fn cpu_percent(mut self, percent: u32) -> Self
Set CPU limit.
Parameters:
timeout_seconds
fn timeout_seconds(mut self, seconds: u32) -> Self
Set timeout.
Parameters:
max_processes
fn max_processes(mut self, max: u32) -> Self
Set max processes.
Parameters:
max_open_files
fn max_open_files(mut self, max: u32) -> Self
Set max open files.
Parameters:
network_enabled
fn network_enabled(mut self, enabled: bool) -> Self
Enable/disable network access.
Parameters:
disk_write_mb
fn disk_write_mb(mut self, mb: u32) -> Self
Set disk write limit.
Parameters:
Source
View on GitHub
praisonai/src/sandbox/mod.rs at line 57