pub struct Config { /* private fields */ }
Expand description
Defines Config struct used to check/set the configuration options.
§Example
The following code shows how to create a Config with ConfigBuilder.
use wasmedge_sdk::{config::{Config, ConfigBuilder, CommonConfigOptions, StatisticsConfigOptions, RuntimeConfigOptions}};
use wasmedge_types::{CompilerOutputFormat, CompilerOptimizationLevel};
let common_options = CommonConfigOptions::default()
.bulk_memory_operations(true)
.multi_value(true)
.mutable_globals(true)
.non_trap_conversions(true)
.reference_types(true)
.sign_extension_operators(true)
.simd(true);
let stat_options = StatisticsConfigOptions::default()
.count_instructions(true)
.measure_cost(true)
.measure_time(true);
let runtime_options = RuntimeConfigOptions::default().max_memory_pages(1024);
let result = ConfigBuilder::new(common_options)
.with_statistics_config(stat_options)
.with_runtime_config(runtime_options)
.build();
assert!(result.is_ok());
let config = result.unwrap();
Implementations§
Source§impl Config
impl Config
Sourcepub fn max_memory_pages(&self) -> u32
pub fn max_memory_pages(&self) -> u32
Returns the number of the memory pages available.
Sourcepub fn mutable_globals_enabled(&self) -> bool
pub fn mutable_globals_enabled(&self) -> bool
Checks if the ImportExportMutGlobals option turns on or not.
Sourcepub fn non_trap_conversions_enabled(&self) -> bool
pub fn non_trap_conversions_enabled(&self) -> bool
Checks if the NonTrapFloatToIntConversions option turns on or not.
Sourcepub fn sign_extension_operators_enabled(&self) -> bool
pub fn sign_extension_operators_enabled(&self) -> bool
Checks if the SignExtensionOperators option turns on or not.
Sourcepub fn multi_value_enabled(&self) -> bool
pub fn multi_value_enabled(&self) -> bool
Checks if the MultiValue option turns on or not.
Sourcepub fn bulk_memory_operations_enabled(&self) -> bool
pub fn bulk_memory_operations_enabled(&self) -> bool
Checks if the BulkMemoryOperations option turns on or not.
Sourcepub fn reference_types_enabled(&self) -> bool
pub fn reference_types_enabled(&self) -> bool
Checks if the ReferenceTypes option turns on or not.
Sourcepub fn simd_enabled(&self) -> bool
pub fn simd_enabled(&self) -> bool
Checks if the SIMD option turns on or not.
Sourcepub fn multi_memories_enabled(&self) -> bool
pub fn multi_memories_enabled(&self) -> bool
Checks if the MultiMemories option turns on or not.
Sourcepub fn threads_enabled(&self) -> bool
pub fn threads_enabled(&self) -> bool
Checks if the Threads option turns on or not.
Sourcepub fn tail_call_enabled(&self) -> bool
pub fn tail_call_enabled(&self) -> bool
Checks if the TailCall option turns on or not.
Sourcepub fn function_references_enabled(&self) -> bool
pub fn function_references_enabled(&self) -> bool
Checks if the FunctionReferences option turns on or not.
Sourcepub fn interpreter_mode_enabled(&self) -> bool
pub fn interpreter_mode_enabled(&self) -> bool
Checks if the ForceInterpreter
option turns on or not.
Sourcepub fn optimization_level(&self) -> CompilerOptimizationLevel
Available on crate feature aot
only.
pub fn optimization_level(&self) -> CompilerOptimizationLevel
aot
only.Returns the optimization level of AOT compiler.
Sourcepub fn out_format(&self) -> CompilerOutputFormat
Available on crate feature aot
only.
pub fn out_format(&self) -> CompilerOutputFormat
aot
only.Returns the output binary format of AOT compiler.
Sourcepub fn dump_ir_enabled(&self) -> bool
Available on crate feature aot
only.
pub fn dump_ir_enabled(&self) -> bool
aot
only.Checks if the dump IR option turns on or not.
Sourcepub fn generic_binary_enabled(&self) -> bool
Available on crate feature aot
only.
pub fn generic_binary_enabled(&self) -> bool
aot
only.Checks if the generic binary option of AOT compiler turns on or not.
Sourcepub fn interruptible_enabled(&self) -> bool
Available on crate feature aot
only.
pub fn interruptible_enabled(&self) -> bool
aot
only.Checks if the Interruptible
option of AOT Compiler turns on or not.
Sourcepub fn instruction_counting_enabled(&self) -> bool
pub fn instruction_counting_enabled(&self) -> bool
Checks if the instruction counting option turns on or not.
Sourcepub fn cost_measuring_enabled(&self) -> bool
pub fn cost_measuring_enabled(&self) -> bool
Checks if the cost measuring option turns on or not.
Sourcepub fn time_measuring_enabled(&self) -> bool
pub fn time_measuring_enabled(&self) -> bool
Checks if the cost measuring option turns on or not.