pub struct Config { /* private fields */ }
Expand description
Configuration for an Engine
.
Implementations§
Source§impl Config
impl Config
Sourcepub fn set_stack_limits(&mut self, stack_limits: StackLimits) -> &mut Self
pub fn set_stack_limits(&mut self, stack_limits: StackLimits) -> &mut Self
Sets the StackLimits
for the Config
.
Sourcepub fn set_cached_stacks(&mut self, amount: usize) -> &mut Self
pub fn set_cached_stacks(&mut self, amount: usize) -> &mut Self
Sourcepub fn wasm_mutable_global(&mut self, enable: bool) -> &mut Self
pub fn wasm_mutable_global(&mut self, enable: bool) -> &mut Self
Sourcepub fn wasm_sign_extension(&mut self, enable: bool) -> &mut Self
pub fn wasm_sign_extension(&mut self, enable: bool) -> &mut Self
Sourcepub fn wasm_saturating_float_to_int(&mut self, enable: bool) -> &mut Self
pub fn wasm_saturating_float_to_int(&mut self, enable: bool) -> &mut Self
Enable or disable the saturating-float-to-int
Wasm proposal for the Config
.
§Note
Enabled by default.
Sourcepub fn wasm_multi_value(&mut self, enable: bool) -> &mut Self
pub fn wasm_multi_value(&mut self, enable: bool) -> &mut Self
Sourcepub fn wasm_multi_memory(&mut self, enable: bool) -> &mut Self
pub fn wasm_multi_memory(&mut self, enable: bool) -> &mut Self
Sourcepub fn wasm_bulk_memory(&mut self, enable: bool) -> &mut Self
pub fn wasm_bulk_memory(&mut self, enable: bool) -> &mut Self
Sourcepub fn wasm_reference_types(&mut self, enable: bool) -> &mut Self
pub fn wasm_reference_types(&mut self, enable: bool) -> &mut Self
Sourcepub fn wasm_tail_call(&mut self, enable: bool) -> &mut Self
pub fn wasm_tail_call(&mut self, enable: bool) -> &mut Self
Sourcepub fn wasm_extended_const(&mut self, enable: bool) -> &mut Self
pub fn wasm_extended_const(&mut self, enable: bool) -> &mut Self
Sourcepub fn floats(&mut self, enable: bool) -> &mut Self
pub fn floats(&mut self, enable: bool) -> &mut Self
Enable or disable Wasm floating point (f32
and f64
) instructions and types.
Enabled by default.
Sourcepub fn consume_fuel(&mut self, enable: bool) -> &mut Self
pub fn consume_fuel(&mut self, enable: bool) -> &mut Self
Configures whether Wasmi will consume fuel during execution to either halt execution as desired.
§Note
This configuration can be used to make Wasmi instrument its internal bytecode
so that it consumes fuel as it executes. Once an execution runs out of fuel
a TrapCode::OutOfFuel
trap is raised.
This way users can deterministically halt or yield the execution of WebAssembly code.
- Use
Store::set_fuel
to set the remaining fuel of theStore
before executing some code as theStore
start with no fuel. - Use
Caller::set_fuel
to update the remaining fuel when executing host functions.
Disabled by default.
Sourcepub fn ignore_custom_sections(&mut self, enable: bool) -> &mut Self
pub fn ignore_custom_sections(&mut self, enable: bool) -> &mut Self
Configures whether Wasmi will ignore custom sections when parsing Wasm modules.
Default value: false
Sourcepub fn compilation_mode(&mut self, mode: CompilationMode) -> &mut Self
pub fn compilation_mode(&mut self, mode: CompilationMode) -> &mut Self
Sets the CompilationMode
used for the Engine
.
By default CompilationMode::Eager
is used.
Sourcepub fn enforced_limits(&mut self, limits: EnforcedLimits) -> &mut Self
pub fn enforced_limits(&mut self, limits: EnforcedLimits) -> &mut Self
Sets the EnforcedLimits
enforced by the Engine
for Wasm module parsing and compilation.
By default no limits are enforced.
Trait Implementations§
impl Copy for Config
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.