Struct wit_bindgen_wrpc_rust::Opts
source · pub struct Opts {Show 19 fields
pub rustfmt: bool,
pub std_feature: bool,
pub raw_strings: bool,
pub skip: Vec<String>,
pub stubs: bool,
pub export_prefix: Option<String>,
pub ownership: Ownership,
pub anyhow_path: Option<String>,
pub async_trait_path: Option<String>,
pub bitflags_path: Option<String>,
pub bytes_path: Option<String>,
pub futures_path: Option<String>,
pub tokio_path: Option<String>,
pub tracing_path: Option<String>,
pub wrpc_transport_path: Option<String>,
pub additional_derive_attributes: Vec<String>,
pub with: Vec<(String, String)>,
pub type_section_suffix: Option<String>,
pub generate_unused_types: bool,
}
Fields§
§rustfmt: bool
Whether or not rustfmt
is executed to format generated code.
std_feature: bool
If true, code generation should qualify any features that depend on
std
with cfg(feature = "std")
.
raw_strings: bool
If true, code generation should pass borrowed string arguments as
&[u8]
instead of &str
. Strings are still required to be valid
UTF-8, but this avoids the need for Rust code to do its own UTF-8
validation if it doesn’t already have a &str
.
skip: Vec<String>
Names of functions to skip generating bindings for.
stubs: bool
If true, generate stub implementations for any exported functions, interfaces, and/or resources.
export_prefix: Option<String>
Optionally prefix any export names with the specified value.
This is useful to avoid name conflicts when testing.
ownership: Ownership
Whether to generate owning or borrowing type definitions.
Valid values include:
-
owning
: Generated types will be composed entirely of owning fields, regardless of whether they are used as parameters to imports or not. -
borrowing
: Generated types used as parameters to imports will be “deeply borrowing”, i.e. contain references rather than owned values when applicable. -
borrowing-duplicate-if-necessary
: As above, but generating distinct types for borrowing and owning, if necessary.
anyhow_path: Option<String>
The optional path to the anyhow
crate to use.
This defaults to wit_bindgen_wrpc::anyhow
.
async_trait_path: Option<String>
The optional path to the async_trait
crate to use.
This defaults to wit_bindgen_wrpc::async_trait
.
bitflags_path: Option<String>
The optional path to the bitflags crate to use.
This defaults to wit_bindgen_wrpc::bitflags
.
bytes_path: Option<String>
The optional path to the bytes
crate to use.
This defaults to wit_bindgen_wrpc::bytes
.
futures_path: Option<String>
The optional path to the futures
crate to use.
This defaults to wit_bindgen_wrpc::futures
.
tokio_path: Option<String>
The optional path to the tokio
crate to use.
This defaults to wit_bindgen_wrpc::tokio
.
tracing_path: Option<String>
The optional path to the tracing
crate to use.
This defaults to wit_bindgen_wrpc::tracing
.
wrpc_transport_path: Option<String>
The optional path to the wrpc-transport
crate to use.
This defaults to wit_bindgen_wrpc::wrpc_transport
.
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
with: Vec<(String, String)>
Remapping of interface names to rust module names.
Argument must be of the form k=v
and this option can be passed
multiple times or one option can be comma separated, for example
k1=v1,k2=v2
.
type_section_suffix: Option<String>
Add the specified suffix to the name of the custome section containing the component type.
generate_unused_types: bool
Whether to generate unused structures, not generated by default (false)