pub struct SandboxConfig {
pub max_operations: usize,
pub max_string_size: usize,
pub max_array_size: usize,
pub max_map_size: usize,
}Expand description
Configuration for the Rhai sandbox.
Fields§
§max_operations: usizeMaximum number of operations before script is terminated
max_string_size: usizeMaximum string size in characters
max_array_size: usizeMaximum array size
max_map_size: usizeMaximum map size
Implementations§
Source§impl SandboxConfig
impl SandboxConfig
Sourcepub fn with_max_operations(self, max: usize) -> Self
pub fn with_max_operations(self, max: usize) -> Self
Set the maximum number of operations.
Sourcepub fn with_max_string_size(self, max: usize) -> Self
pub fn with_max_string_size(self, max: usize) -> Self
Set the maximum string size.
Sourcepub fn with_max_array_size(self, max: usize) -> Self
pub fn with_max_array_size(self, max: usize) -> Self
Set the maximum array size.
Sourcepub fn with_max_map_size(self, max: usize) -> Self
pub fn with_max_map_size(self, max: usize) -> Self
Set the maximum map size.
Trait Implementations§
Source§impl Clone for SandboxConfig
impl Clone for SandboxConfig
Source§fn clone(&self) -> SandboxConfig
fn clone(&self) -> SandboxConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SandboxConfig
impl Debug for SandboxConfig
Auto Trait Implementations§
impl Freeze for SandboxConfig
impl RefUnwindSafe for SandboxConfig
impl Send for SandboxConfig
impl Sync for SandboxConfig
impl Unpin for SandboxConfig
impl UnsafeUnpin for SandboxConfig
impl UnwindSafe for SandboxConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more