pub struct SandboxLimits {
pub wall_clock: Duration,
pub cpu: Duration,
pub memory_bytes: u64,
pub max_open_files: u64,
pub allow_network: bool,
}Expand description
Resource limits enforced on the child process (T080 / FR-017).
Defaults are pinned by FR-017:
| Limit | Default | Rationale |
|---|---|---|
wall_clock | 120 s | Real-time deadline enforced by parent. |
cpu | 60 s | RLIMIT_CPU seconds. |
memory_bytes | 1 GiB | RLIMIT_AS address space cap. |
max_open_files | 256 | RLIMIT_NOFILE hard + soft. |
allow_network | false | Linux: unshare(CLONE_NEWNET). |
On macOS unshare is unavailable and the network-off invariant degrades to
“child has no configured provider” — documented as a known limitation in
specs/043-evals-adv-features/research.md §R-006.
Fields§
§wall_clock: DurationReal-time deadline. The parent SIGKILLs the child on expiry.
cpu: DurationCPU seconds via RLIMIT_CPU. Child receives SIGXCPU on expiry.
memory_bytes: u64Virtual address space ceiling via RLIMIT_AS.
max_open_files: u64File-descriptor ceiling via RLIMIT_NOFILE.
allow_network: boolWhether the child may open external network connections.
Trait Implementations§
Source§impl Clone for SandboxLimits
impl Clone for SandboxLimits
Source§fn clone(&self) -> SandboxLimits
fn clone(&self) -> SandboxLimits
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 SandboxLimits
impl Debug for SandboxLimits
Auto Trait Implementations§
impl Freeze for SandboxLimits
impl RefUnwindSafe for SandboxLimits
impl Send for SandboxLimits
impl Sync for SandboxLimits
impl Unpin for SandboxLimits
impl UnsafeUnpin for SandboxLimits
impl UnwindSafe for SandboxLimits
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