pub struct EngineConfig {
pub limits: Limits,
pub capabilities: Capabilities,
pub sandbox: SandboxConfig,
pub debug: bool,
pub metadata: HashMap<String, String>,
}Expand description
Configuration for creating an Engine.
Fields§
§limits: LimitsResource limits.
capabilities: CapabilitiesCapabilities granted to scripts.
sandbox: SandboxConfigSandbox configuration.
debug: boolWhether to enable debug mode.
metadata: HashMap<String, String>Custom metadata to attach to the engine.
Implementations§
Source§impl EngineConfig
impl EngineConfig
Sourcepub fn with_limits(self, limits: Limits) -> Self
pub fn with_limits(self, limits: Limits) -> Self
Set resource limits.
Sourcepub fn with_capabilities(self, capabilities: Capabilities) -> Self
pub fn with_capabilities(self, capabilities: Capabilities) -> Self
Set capabilities.
Sourcepub fn with_sandbox(self, sandbox: SandboxConfig) -> Self
pub fn with_sandbox(self, sandbox: SandboxConfig) -> Self
Set sandbox configuration.
Sourcepub fn with_debug(self, debug: bool) -> Self
pub fn with_debug(self, debug: bool) -> Self
Enable debug mode.
Sourcepub fn with_metadata(
self,
key: impl Into<String>,
value: impl Into<String>,
) -> Self
pub fn with_metadata( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
Add metadata.
Sourcepub fn permissive() -> Self
pub fn permissive() -> Self
Create a permissive configuration for trusted code.
Trait Implementations§
Source§impl Clone for EngineConfig
impl Clone for EngineConfig
Source§fn clone(&self) -> EngineConfig
fn clone(&self) -> EngineConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 EngineConfig
impl Debug for EngineConfig
Auto Trait Implementations§
impl Freeze for EngineConfig
impl RefUnwindSafe for EngineConfig
impl Send for EngineConfig
impl Sync for EngineConfig
impl Unpin for EngineConfig
impl UnwindSafe for EngineConfig
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