pub struct Opts {Show 14 fields
pub rustfmt: bool,
pub tracing: bool,
pub verbose_tracing: bool,
pub async_: AsyncConfig,
pub trappable_error_type: Vec<TrappableError>,
pub ownership: Ownership,
pub only_interfaces: bool,
pub trappable_imports: TrappableImports,
pub with: HashMap<String, String>,
pub additional_derive_attributes: Vec<String>,
pub stringify: bool,
pub skip_mut_forwarding_impls: bool,
pub require_store_data_send: bool,
pub wasmtime_crate: Option<String>,
}
Fields§
§rustfmt: bool
Whether or not rustfmt
is executed to format generated code.
tracing: bool
Whether or not to emit tracing
macro calls on function entry/exit.
verbose_tracing: bool
Whether or not tracing
macro calls should included argument and
return values which contain dynamically-sized list
values.
async_: AsyncConfig
Whether or not to use async rust functions and traits.
trappable_error_type: Vec<TrappableError>
A list of “trappable errors” which are used to replace the E
in
result<T, E>
found in WIT.
ownership: Ownership
Whether to generate owning or borrowing type definitions.
only_interfaces: bool
Whether or not to generate code for only the interfaces of this wit file or not.
trappable_imports: TrappableImports
Configuration of which imports are allowed to generate a trap.
with: HashMap<String, String>
Remapping of interface names to rust module names. TODO: is there a better type to use for the value of this map?
additional_derive_attributes: Vec<String>
Additional derive attributes to add to generated types. If using in a CLI, this flag can be specified multiple times to add multiple attributes.
These derive attributes will be added to any generated structs or enums
stringify: bool
Evaluate to a string literal containing the generated code rather than the generated tokens themselves. Mostly useful for Wasmtime internal debugging and development.
skip_mut_forwarding_impls: bool
Temporary option to skip impl<T: Trait> Trait for &mut T
for the
wasmtime-wasi
crate while that’s given a chance to update its b
indings.
require_store_data_send: bool
Indicates that the T
in Store<T>
should be send even if async is not
enabled.
This is helpful when sync bindings depend on generated functions from async bindings as is the case with WASI in-tree.
wasmtime_crate: Option<String>
Path to the wasmtime
crate if it’s not the default path.