Struct wasm_smith::SwarmConfig
source · [−]pub struct SwarmConfig {Show 46 fields
pub allow_start_export: bool,
pub available_imports: Option<Vec<u8>>,
pub bulk_memory_enabled: bool,
pub canonicalize_nans: bool,
pub exceptions_enabled: bool,
pub max_aliases: usize,
pub max_components: usize,
pub max_data_segments: usize,
pub max_element_segments: usize,
pub max_elements: usize,
pub max_exports: usize,
pub max_funcs: usize,
pub max_globals: usize,
pub max_imports: usize,
pub max_instances: usize,
pub max_instructions: usize,
pub max_memories: usize,
pub max_memory_pages: u64,
pub max_modules: usize,
pub max_nesting_depth: usize,
pub max_tables: usize,
pub max_tags: usize,
pub max_type_size: u32,
pub max_types: usize,
pub max_values: usize,
pub memory64_enabled: bool,
pub memory_max_size_required: bool,
pub memory_offset_choices: (u32, u32, u32),
pub min_data_segments: usize,
pub min_element_segments: usize,
pub min_elements: usize,
pub min_exports: usize,
pub min_funcs: usize,
pub min_globals: usize,
pub min_imports: usize,
pub min_memories: u32,
pub min_tables: u32,
pub min_tags: usize,
pub min_types: usize,
pub min_uleb_size: u8,
pub multi_value_enabled: bool,
pub reference_types_enabled: bool,
pub relaxed_simd_enabled: bool,
pub saturating_float_to_int_enabled: bool,
pub sign_extension_enabled: bool,
pub simd_enabled: bool,
}
Expand description
A module configuration that uses swarm testing.
Dynamically – but still deterministically, via its Arbitrary
implementation – chooses configuration options.
Note that we pick only maximums, not minimums, here because it is more
complex to describe the domain of valid configs when minima are involved
(min <= max
for each variable) and minima are mostly used to ensure
certain elements are present, but do not widen the range of generated Wasm
modules.
Fields
allow_start_export: bool
available_imports: Option<Vec<u8>>
bulk_memory_enabled: bool
canonicalize_nans: bool
exceptions_enabled: bool
max_aliases: usize
max_components: usize
max_data_segments: usize
max_element_segments: usize
max_elements: usize
max_exports: usize
max_funcs: usize
max_globals: usize
max_imports: usize
max_instances: usize
max_instructions: usize
max_memories: usize
max_memory_pages: u64
max_modules: usize
max_nesting_depth: usize
max_tables: usize
max_type_size: u32
max_types: usize
max_values: usize
memory64_enabled: bool
memory_max_size_required: bool
memory_offset_choices: (u32, u32, u32)
min_data_segments: usize
min_element_segments: usize
min_elements: usize
min_exports: usize
min_funcs: usize
min_globals: usize
min_imports: usize
min_memories: u32
min_tables: u32
min_types: usize
min_uleb_size: u8
multi_value_enabled: bool
reference_types_enabled: bool
relaxed_simd_enabled: bool
saturating_float_to_int_enabled: bool
sign_extension_enabled: bool
simd_enabled: bool
Trait Implementations
sourceimpl<'a> Arbitrary<'a> for SwarmConfig
impl<'a> Arbitrary<'a> for SwarmConfig
sourcefn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
Generate an arbitrary value of Self
from the given unstructured data. Read more
sourcefn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
Generate an arbitrary value of Self
from the entirety of the given unstructured data. Read more
sourceimpl Clone for SwarmConfig
impl Clone for SwarmConfig
sourcefn clone(&self) -> SwarmConfig
fn clone(&self) -> SwarmConfig
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Config for SwarmConfig
impl Config for SwarmConfig
sourcefn min_imports(&self) -> usize
fn min_imports(&self) -> usize
The minimum number of imports to generate. Defaults to 0. Read more
sourcefn max_imports(&self) -> usize
fn max_imports(&self) -> usize
The maximum number of imports to generate. Defaults to 100.
sourcefn available_imports(&self) -> Option<Cow<'_, [u8]>>
fn available_imports(&self) -> Option<Cow<'_, [u8]>>
The imports that may be used when generating the module. Read more
sourcefn min_funcs(&self) -> usize
fn min_funcs(&self) -> usize
The minimum number of functions to generate. Defaults to 0. This includes imported functions. Read more
sourcefn max_funcs(&self) -> usize
fn max_funcs(&self) -> usize
The maximum number of functions to generate. Defaults to 100. This includes imported functions. Read more
sourcefn min_globals(&self) -> usize
fn min_globals(&self) -> usize
The minimum number of globals to generate. Defaults to 0. This includes imported globals. Read more
sourcefn max_globals(&self) -> usize
fn max_globals(&self) -> usize
The maximum number of globals to generate. Defaults to 100. This includes imported globals. Read more
sourcefn min_exports(&self) -> usize
fn min_exports(&self) -> usize
The minimum number of exports to generate. Defaults to 0.
sourcefn max_exports(&self) -> usize
fn max_exports(&self) -> usize
The maximum number of exports to generate. Defaults to 100.
sourcefn min_element_segments(&self) -> usize
fn min_element_segments(&self) -> usize
The minimum number of element segments to generate. Defaults to 0.
sourcefn max_element_segments(&self) -> usize
fn max_element_segments(&self) -> usize
The maximum number of element segments to generate. Defaults to 100.
sourcefn min_elements(&self) -> usize
fn min_elements(&self) -> usize
The minimum number of elements within a segment to generate. Defaults to 0. Read more
sourcefn max_elements(&self) -> usize
fn max_elements(&self) -> usize
The maximum number of elements within a segment to generate. Defaults to 100. Read more
sourcefn min_data_segments(&self) -> usize
fn min_data_segments(&self) -> usize
The minimum number of data segments to generate. Defaults to 0.
sourcefn max_data_segments(&self) -> usize
fn max_data_segments(&self) -> usize
The maximum number of data segments to generate. Defaults to 100.
sourcefn max_instructions(&self) -> usize
fn max_instructions(&self) -> usize
The maximum number of instructions to generate in a function body. Defaults to 100. Read more
sourcefn min_memories(&self) -> u32
fn min_memories(&self) -> u32
The minimum number of memories to use. Defaults to 0. This includes imported memories. Read more
sourcefn max_memories(&self) -> usize
fn max_memories(&self) -> usize
The maximum number of memories to use. Defaults to 1. This includes imported memories. Read more
sourcefn min_tables(&self) -> u32
fn min_tables(&self) -> u32
The minimum number of tables to use. Defaults to 0. This includes imported tables. Read more
sourcefn max_tables(&self) -> usize
fn max_tables(&self) -> usize
The maximum number of tables to use. Defaults to 1. This includes imported tables. Read more
sourcefn max_memory_pages(&self, is_64: bool) -> u64
fn max_memory_pages(&self, is_64: bool) -> u64
The maximum, in 64k Wasm pages, of any memory’s initial or maximum size. Read more
sourcefn memory_max_size_required(&self) -> bool
fn memory_max_size_required(&self) -> bool
Whether every Wasm memory must have a maximum size specified. Defaults
to false
. Read more
sourcefn max_instances(&self) -> usize
fn max_instances(&self) -> usize
The maximum number of instances to use. Defaults to 10. This includes imported instances. Read more
sourcefn max_modules(&self) -> usize
fn max_modules(&self) -> usize
The maximum number of modules to use. Defaults to 10. This includes imported modules. Read more
sourcefn memory_offset_choices(&self) -> (u32, u32, u32)
fn memory_offset_choices(&self) -> (u32, u32, u32)
Control the probability of generating memory offsets that are in bounds vs. potentially out of bounds. Read more
sourcefn min_uleb_size(&self) -> u8
fn min_uleb_size(&self) -> u8
The minimum size, in bytes, of all leb-encoded integers. Defaults to 1. Read more
sourcefn bulk_memory_enabled(&self) -> bool
fn bulk_memory_enabled(&self) -> bool
Determines whether the bulk memory proposal is enabled for generating instructions. Read more
sourcefn reference_types_enabled(&self) -> bool
fn reference_types_enabled(&self) -> bool
Determines whether the reference types proposal is enabled for generating instructions. Read more
sourcefn simd_enabled(&self) -> bool
fn simd_enabled(&self) -> bool
Determines whether the SIMD proposal is enabled for generating instructions. Read more
sourcefn relaxed_simd_enabled(&self) -> bool
fn relaxed_simd_enabled(&self) -> bool
Determines whether the Relaxed SIMD proposal is enabled for generating instructions. Read more
sourcefn exceptions_enabled(&self) -> bool
fn exceptions_enabled(&self) -> bool
Determines whether the exception-handling proposal is enabled for generating instructions. Read more
sourcefn multi_value_enabled(&self) -> bool
fn multi_value_enabled(&self) -> bool
Determines whether the multi-value results are enabled. Read more
sourcefn saturating_float_to_int_enabled(&self) -> bool
fn saturating_float_to_int_enabled(&self) -> bool
Determines whether the nontrapping-float-to-int-conversions propsal is enabled. Read more
sourcefn sign_extension_ops_enabled(&self) -> bool
fn sign_extension_ops_enabled(&self) -> bool
Determines whether the sign-extension-ops propsal is enabled. Read more
sourcefn allow_start_export(&self) -> bool
fn allow_start_export(&self) -> bool
Determines whether a start
export may be included. Defaults to true
.
sourcefn max_aliases(&self) -> usize
fn max_aliases(&self) -> usize
Returns the maximal size of the alias
section.
sourcefn max_nesting_depth(&self) -> usize
fn max_nesting_depth(&self) -> usize
Returns the maximal nesting depth of modules with the module linking proposal. Read more
sourcefn max_type_size(&self) -> u32
fn max_type_size(&self) -> u32
Returns the maximal effective size of any type generated by wasm-smith. Read more
sourcefn memory64_enabled(&self) -> bool
fn memory64_enabled(&self) -> bool
Returns whether 64-bit memories are allowed. Read more
sourcefn canonicalize_nans(&self) -> bool
fn canonicalize_nans(&self) -> bool
Returns whether NaN values are canonicalized after all f32/f64 operation. Read more
The minimum number of tags to generate. Defaults to 0.
The maximum number of tags to generate. Defaults to 100.
sourcefn max_components(&self) -> usize
fn max_components(&self) -> usize
The maximum number of components to use. Defaults to 10. This includes imported components. Read more
sourcefn max_values(&self) -> usize
fn max_values(&self) -> usize
The maximum number of values to use. Defaults to 10. This includes imported values. Read more
sourcefn allowed_instructions(&self) -> InstructionKinds
fn allowed_instructions(&self) -> InstructionKinds
Returns the kinds of instructions allowed in the generated wasm programs. Read more
sourcefn generate_custom_sections(&self) -> bool
fn generate_custom_sections(&self) -> bool
Returns whether we should generate custom sections or not. Read more
Auto Trait Implementations
impl RefUnwindSafe for SwarmConfig
impl Send for SwarmConfig
impl Sync for SwarmConfig
impl Unpin for SwarmConfig
impl UnwindSafe for SwarmConfig
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more