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

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]

pub fn permissive() -> RestrictConfig[src]

Returns a RestrictConfig that is most permissive.

No restrictions are placed on executing code.

pub fn strict() -> RestrictConfig[src]

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]

impl Debug for RestrictConfig[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,