[−][src]Struct walrus::ModuleConfig
Configuration for a Module
which currently affects parsing.
Methods
impl ModuleConfig
[src]
pub fn new() -> ModuleConfig
[src]
Creates a fresh new configuration with default settings.
pub fn generate_dwarf(&mut self, generate: bool) -> &mut ModuleConfig
[src]
Sets a flag to whether DWARF debug sections are generated for this module.
By default this flag is false
. Note that any emitted DWARF is
currently wildly incorrect and buggy, and is also larger than the wasm
itself!
pub fn generate_name_section(&mut self, generate: bool) -> &mut ModuleConfig
[src]
Sets a flag to whether the custom "name" section is generated for this module.
The "name" section contains symbol names for the module, functions, and
locals. When enabled, stack traces will use these names, instead of
wasm-function[123]
.
By default this flag is true
.
pub fn generate_synthetic_names_for_anonymous_items(
&mut self,
generate: bool
) -> &mut ModuleConfig
[src]
&mut self,
generate: bool
) -> &mut ModuleConfig
Sets a flag to whether synthetic debugging names are generated for anonymous locals/functions/etc when parsing and running passes for this module.
By default this flag is false
, and it will generate quite a few names
if enabled!
pub fn strict_validate(&mut self, strict: bool) -> &mut ModuleConfig
[src]
Indicates whether the module, after parsing, performs strict validation of the wasm module to adhere with the current version of the wasm specification.
This can be expensive for some modules and strictly isn't required to
create a Module
from a wasm file. This includes checks such as "atomic
instructions require a shared memory".
By default this flag is true
pub fn generate_producers_section(
&mut self,
generate: bool
) -> &mut ModuleConfig
[src]
&mut self,
generate: bool
) -> &mut ModuleConfig
Indicates whether the module will have the "producers" custom section
which preserves the original producers and also includes walrus
.
This is generally used for telemetry in browsers, but for otherwise tiny wasm binaries can add some size to the binary.
By default this flag is true
pub fn only_stable_features(&mut self, only: bool) -> &mut ModuleConfig
[src]
Indicates whether this module is allowed to use only stable WebAssembly features or not.
This is currently used to disable some validity checks required by the
WebAssembly specification. It's not religiously adhered to throughout
the codebase, even if set to true
some unstable features may still be
allowed.
By default this flag is false
pub fn parse(&self, wasm: &[u8]) -> Result<Module>
[src]
Parses an in-memory WebAssembly file into a Module
using this
configuration.
pub fn parse_file<P>(&self, path: P) -> Result<Module> where
P: AsRef<Path>,
[src]
P: AsRef<Path>,
Parses a WebAssembly file into a Module
using this configuration.
Trait Implementations
impl Default for ModuleConfig
[src]
fn default() -> ModuleConfig
[src]
impl Clone for ModuleConfig
[src]
fn clone(&self) -> ModuleConfig
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for ModuleConfig
[src]
Auto Trait Implementations
impl Send for ModuleConfig
impl Sync for ModuleConfig
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,