pub struct CommonOptions {
Show 25 fields pub config: Option<PathBuf>, pub disable_logging: bool, pub log_to_files: bool, pub debug_info: bool, pub disable_cache: bool, pub disable_parallel_compilation: bool, pub wasm_features: Option<WasmFeatures>, pub wasi_modules: Option<WasiModules>, pub jitdump: bool, pub vtune: bool, pub optimize: bool, pub opt_level: Option<OptLevel>, pub cranelift_set: Vec<(String, String)>, pub cranelift_enable: Vec<String>, pub static_memory_maximum_size: Option<u64>, pub static_memory_forced: bool, pub static_memory_guard_size: Option<u64>, pub dynamic_memory_guard_size: Option<u64>, pub enable_cranelift_debug_verifier: bool, pub enable_cranelift_nan_canonicalization: bool, pub fuel: Option<u64>, pub epoch_interruption: bool, pub disable_address_map: bool, pub disable_memory_init_cow: bool, pub max_wasm_stack: Option<usize>,
}
Expand description

Common options for commands that translate WebAssembly modules

Fields§

§config: Option<PathBuf>

Use specified configuration file

§disable_logging: bool

Disable logging

§log_to_files: bool

Log to per-thread log files instead of stderr

§debug_info: bool

Generate debug information

§disable_cache: bool

Disable cache system

§disable_parallel_compilation: bool

Disable parallel compilation

§wasm_features: Option<WasmFeatures>

Enable or disable WebAssembly features

§wasi_modules: Option<WasiModules>

Enable or disable WASI modules

§jitdump: bool

Generate jitdump file (supported on –features=profiling build)

§vtune: bool

Generate vtune (supported on –features=vtune build)

§optimize: bool

Run optimization passes on translated functions, on by default

§opt_level: Option<OptLevel>

Optimization level for generated functions Supported levels: 0 (none), 1, 2 (most), or s (size); default is “most”

§cranelift_set: Vec<(String, String)>

Set a Cranelift setting to a given value. Use wasmtime settings to list Cranelift settings for a target.

§cranelift_enable: Vec<String>

Enable a Cranelift boolean setting or preset. Use wasmtime settings to list Cranelift settings for a target.

§static_memory_maximum_size: Option<u64>

Maximum size in bytes of wasm memory before it becomes dynamically relocatable instead of up-front-reserved.

§static_memory_forced: bool

Force using a “static” style for all wasm memories

§static_memory_guard_size: Option<u64>

Byte size of the guard region after static memories are allocated

§dynamic_memory_guard_size: Option<u64>

Byte size of the guard region after dynamic memories are allocated

§enable_cranelift_debug_verifier: bool

Enable Cranelift’s internal debug verifier (expensive)

§enable_cranelift_nan_canonicalization: bool

Enable Cranelift’s internal NaN canonicalization

§fuel: Option<u64>

Enable execution fuel with N units fuel, where execution will trap after running out of fuel.

Most WebAssembly instructions consume 1 unit of fuel. Some instructions, such as nop, drop, block, and loop, consume 0 units, as any execution cost associated with them involves other instructions which do consume fuel.

§epoch_interruption: bool

Executing wasm code will yield when a global epoch counter changes, allowing for async operation without blocking the executor.

§disable_address_map: bool

Disable the on-by-default address map from native code to wasm code

§disable_memory_init_cow: bool

Disable the default of attempting to initialize linear memory via a copy-on-write mapping

§max_wasm_stack: Option<usize>

Maximum stack size, in bytes, that wasm is allowed to consume before a stack overflow is reported.

Implementations§

source§

impl CommonOptions

source

pub fn init_logging(&self)

source

pub fn config(&self, target: Option<&str>) -> Result<Config>

source

pub fn enable_wasm_features(&self, config: &mut Config)

source

pub fn opt_level(&self) -> OptLevel

Trait Implementations§

source§

impl Args for CommonOptions

source§

fn augment_args<'b>(__clap_app: Command<'b>) -> Command<'b>

Append to Command so it can instantiate Self. Read more
source§

fn augment_args_for_update<'b>(__clap_app: Command<'b>) -> Command<'b>

Append to Command so it can update self. Read more
source§

impl CommandFactory for CommonOptions

source§

fn into_app<'b>() -> Command<'b>

Deprecated, replaced with CommandFactory::command
source§

fn into_app_for_update<'b>() -> Command<'b>

Deprecated, replaced with CommandFactory::command_for_update
source§

fn command<'help>() -> App<'help>

Build a Command that can instantiate Self. Read more
source§

fn command_for_update<'help>() -> App<'help>

Build a Command that can update self. Read more
source§

impl FromArgMatches for CommonOptions

source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches ) -> Result<(), Error>

Assign values from ArgMatches to self.
source§

fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches ) -> Result<(), Error>

Assign values from ArgMatches to self.
source§

impl Parser for CommonOptions

source§

fn parse() -> Self

Parse from std::env::args_os(), exit on error
source§

fn try_parse() -> Result<Self, Error>

Parse from std::env::args_os(), return Err on error.
source§

fn parse_from<I, T>(itr: I) -> Selfwhere I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, exit on error
source§

fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, return Err on error.
source§

fn update_from<I, T>(&mut self, itr: I)where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, exit on error
source§

fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, return Err on error.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.