pub struct Config { /* private fields */ }
Implementations§
source§impl Config
impl Config
sourcepub fn from_env() -> Result<Self, Error>
pub fn from_env() -> Result<Self, Error>
Creates a new default configuration and seeds it from the environment variables.
sourcepub fn set_backend(&mut self, backend: Option<BackendKind>) -> &mut Self
pub fn set_backend(&mut self, backend: Option<BackendKind>) -> &mut Self
Forces the use of a given backend.
Default: None
(automatically pick the best available backend)
Corresponding environment variable: POLKAVM_BACKEND
(auto
, compiler
, interpreter
)
sourcepub fn backend(&self) -> Option<BackendKind>
pub fn backend(&self) -> Option<BackendKind>
Gets the currently set backend, if any.
sourcepub fn set_sandbox(&mut self, sandbox: Option<SandboxKind>) -> &mut Self
pub fn set_sandbox(&mut self, sandbox: Option<SandboxKind>) -> &mut Self
Forces the use of a given sandbox.
Default: None
(automatically pick the best available sandbox)
Corresponding environment variable: POLKAVM_SANDBOX
(auto
, linux
, generic
)
sourcepub fn sandbox(&self) -> Option<SandboxKind>
pub fn sandbox(&self) -> Option<SandboxKind>
Gets the currently set sandbox, if any.
sourcepub fn set_trace_execution(&mut self, value: bool) -> &mut Self
pub fn set_trace_execution(&mut self, value: bool) -> &mut Self
Enables execution tracing.
Requires set_allow_insecure
to be true
.
Default: false
Corresponding environment variable: POLKAVM_TRACE_EXECUTION
(true
, false
)
sourcepub fn trace_execution(&self) -> bool
pub fn trace_execution(&self) -> bool
Returns whether the execution tracing is enabled.
sourcepub fn set_allow_insecure(&mut self, value: bool) -> &mut Self
pub fn set_allow_insecure(&mut self, value: bool) -> &mut Self
Enabling this makes it possible to enable other settings which can introduce unsafety or break determinism.
Should only be used for debugging purposes and never enabled by default in production.
Default: false
Corresponding environment variable: POLKAVM_ALLOW_INSECURE
(true
, false
)
sourcepub fn set_worker_count(&mut self, value: usize) -> &mut Self
pub fn set_worker_count(&mut self, value: usize) -> &mut Self
Sets the number of worker sandboxes that will be permanently kept alive by the engine.
This doesn’t limit the number of instances that can be instantiated at the same time; it will just tell the engine how many sandboxes should be cached between instantiations.
For the Linux sandbox this will decide how many worker processes are kept alive.
This only has an effect when using a recompiler. For the interpreter this setting will be ignored.
Default: 2
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)