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
execution_time: Option<Duration>
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.
call_stack_size: usize
Limits the call stack depth during execution to a number of nested functions calls
value_stack_size: usize
Limits the number of values that can be stored on the stack during execution
namespace_size: usize
Limits the maximum number of values that can be stored in a GlobalScope
memory_limit: usize
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.
max_integer_size: usize
Maximum size, in bits, of integer and ratio values
max_syntax_nesting: usize
Maximum nested depth of syntactical elements
Methods
impl RestrictConfig
[src]
fn permissive() -> RestrictConfig
Returns a RestrictConfig
that is most permissive.
No restrictions are placed on executing code.
fn strict() -> RestrictConfig
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]
fn clone(&self) -> RestrictConfig
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more