pub struct Opts {Show 13 fields
pub rustfmt: bool,
pub 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: boolWhether or not rustfmt is executed to format generated code.
tracing: boolWhether or not to emit tracing macro calls on function entry/exit.
async_: AsyncConfigWhether 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: OwnershipWhether to generate owning or borrowing type definitions.
only_interfaces: boolWhether or not to generate code for only the interfaces of this wit file or not.
trappable_imports: TrappableImportsConfiguration 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: boolEvaluate 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: boolTemporary 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: boolIndicates 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.