pub struct Limits {
pub fuel: Option<u64>,
pub deadline: Option<Duration>,
pub max_host_calls: Option<u64>,
pub max_call_depth: Option<usize>,
pub max_tasks: Option<u64>,
}Expand description
Limits a host imposes on one run.
A None field imposes nothing: Limits::default() never stops a run.
Fields§
§fuel: Option<u64>The total fuel a run may spend before it is stopped.
deadline: Option<Duration>The wall-clock duration a run may take before it is stopped.
max_host_calls: Option<u64>The total number of host calls a run may make before it is stopped.
max_call_depth: Option<usize>The deepest a call may nest before it is stopped.
max_tasks: Option<u64>The tasks a run may have alive at once before it is stopped.
ADR 0001 lists concurrency limits beside CPU and time, and a
thread is the one resource a program can take without asking for it.
So this limit is charged where the taking happens: spawn charges it
before a thread exists, and a spawn past the limit stops the run
rather than waiting for a sibling to finish, because waiting would be
a scheduling policy and ADR 0008 has none. Like fuel and host calls,
it bounds the run: every task alive anywhere in it counts, so
a program cannot stay under the limit by spreading its tasks over more
scopes.