pub struct Opts {Show 13 fields
pub rustfmt: bool,
pub trappable_error_type: Vec<TrappableError>,
pub ownership: Ownership,
pub only_interfaces: bool,
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>,
pub debug: bool,
pub imports: FunctionConfig,
pub exports: FunctionConfig,
}
Fields§
§rustfmt: bool
Whether or not rustfmt
is executed to format generated code.
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.
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.
debug: bool
If true, write the generated bindings to a file for better error
messages from rustc
.
This can also be toggled via the WASMTIME_DEBUG_BINDGEN
environment
variable, but that will affect all bindgen!
macro invocations (and
can sometimes lead to one invocation overwriting another in unpredictable
ways), whereas this option lets you specify it on a case-by-case basis.
imports: FunctionConfig
TODO
exports: FunctionConfig
TODO