Struct ketos::restrict::RestrictConfig [] [src]

pub struct RestrictConfig {
    pub execution_time: Option<Duration>,
    pub call_stack_size: usize,
    pub value_stack_size: usize,
    pub namespace_size: usize,
    pub memory_limit: usize,
    pub max_integer_size: usize,
    pub max_syntax_nesting: usize,
}

Contains parameters configuring restrictions of runtime code execution

See module-level documentation for an example of its use.

Fields

Limits the maximum execution time, beginning from a call into the virtual machine, until the topmost function returns.

If the user desires to limit total execution time of multiple separate function calls, the user must track execution time and adjust this limit manually.

Limits the call stack depth during execution to a number of nested functions calls

Limits the number of values that can be stored on the stack during execution

Limits the maximum number of values that can be stored in a GlobalScope

Memory limit during execution of code. This is not a specific measure of bytes; it's more an abstract estimate of values held during execution.

Maximum size, in bits, of integer and ratio values

Maximum nested depth of syntactical elements

Methods

impl RestrictConfig
[src]

Returns a RestrictConfig that is most permissive.

No restrictions are placed on executing code.

Returns a RestrictConfig that is most strict.

Small programs with short runtimes should not have a problem operating within these restrictions.

Trait Implementations

impl Clone for RestrictConfig
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for RestrictConfig
[src]

Formats the value using the given formatter.