pub struct SandboxConfig {
pub instruction_limit: Option<u64>,
pub memory_limit_bytes: Option<usize>,
pub check_interval: u32,
pub remove_globals: Vec<Vec<u8>>,
}Expand description
Configuration for Lua::sandboxed.
Fields§
§instruction_limit: Option<u64>Maximum VM instructions a run may execute. None = unlimited.
memory_limit_bytes: Option<usize>Maximum GC-tracked bytes. None = unlimited.
check_interval: u32Instructions between budget/memory checks. Lower = tighter enforcement, higher hook overhead. Clamped to at least 1.
remove_globals: Vec<Vec<u8>>Global paths to delete before running, e.g. b"os.execute" or b"io".
A .-separated path nils a field of a sub-table; a bare name nils a
top-level global.
Implementations§
Source§impl SandboxConfig
impl SandboxConfig
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