Skip to main content

Limits

Struct Limits 

Source
pub struct Limits {
    pub wall_timeout: Duration,
    pub max_response_bytes: u32,
    pub max_stderr_bytes: u64,
    pub address_space_bytes: Option<u64>,
    pub cpu_seconds: u64,
    pub file_size_bytes: u64,
    pub max_processes: u64,
    pub max_resident_bytes: Option<u64>,
}
Expand description

Resource and output limits for one adapter class.

Fields§

§wall_timeout: Duration

Wall-clock ceiling enforced by the parent.

§max_response_bytes: u32

Ceiling on the response frame payload, checked against the declared length before allocation.

§max_stderr_bytes: u64

Ceiling on stderr bytes, drained and counted concurrently.

§address_space_bytes: Option<u64>

RLIMIT_AS for the child, in bytes. None leaves the limit unset, the shape a profile takes on a platform where the mapped accelerator runtime reserves a virtual range no sane cap sits above; the resident-memory guard below is the bound there.

§cpu_seconds: u64

RLIMIT_CPU for the child, in seconds.

§file_size_bytes: u64

RLIMIT_FSIZE for the child, in bytes. Caps regular-file growth inside the jail. Stdout is a pipe, so the response cap above is enforced by the parent instead.

§max_processes: u64

RLIMIT_NPROC for the child: this invocation’s spawn budget, so a compromised adapter cannot fork-bomb the host. The limit counts every process of the mapped real user id, not just this invocation’s descendants, so the helper applies the number as headroom above the count that already exists at spawn, clamped to the hard limit. The semantic is defined there once and holds for every profile. A count the host will not answer refuses the run with process-count-unavailable, never a substituted baseline.

§max_resident_bytes: Option<u64>

Parent-side ceiling on the aggregate resident bytes of the child’s whole process group, engine descendants included. The parent polls the group while the child runs, kills the group when the sum crosses the ceiling, and fails closed with worker-memory-exceeded. A failed measurement is itself a failure, memory-monitor-failed, never a silent pass. None disables the monitor, the shape of every profile whose worker spawns no engine child.

Trait Implementations§

Source§

impl Clone for Limits

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Limits

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Limits

Source§

fn default() -> Limits

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.