pub struct Opts {
    pub rustfmt: bool,
    pub multi_module: bool,
    pub unchecked: bool,
    pub symbol_namespace: String,
    pub export_macro: Option<String>,
    pub types_path: Option<String>,
    pub reexported_crate_path: Option<String>,
}

Fields§

§rustfmt: bool

Whether or not rustfmt is executed to format generated code.

§multi_module: bool

Adds the wit module name into import binding names when enabled.

§unchecked: bool

Whether or not the bindings assume interface values are always well-formed or whether checks are performed.

§symbol_namespace: String

A prefix to prepend to all exported symbols. Note that this is only intended for testing because it breaks the general form of the ABI.

§export_macro: Option<String>

If set, the code generation is intended for standalone crates.

Standalone mode generates bindings without a wrapping module.

For exported interfaces, an export macro is also generated that can be used to export an implementation from a different crate.

§types_path: Option<String>

Path inside the standalone crate where the generated types can be found.

Used inside the export macro and is prefixed with $crate::.

§reexported_crate_path: Option<String>

Path to access this crate from inside the generated macro if it has been re-exported.

This is only relevant if the [export_macro] is set, and is prefixed with $crate::. If it is not set, the generated code will use the crate assuming it has been declared as a dependency by the crate that uses the macro.

Implementations§

source§

impl Opts

source

pub fn build(self) -> RustWasm

Trait Implementations§

source§

impl Clone for Opts

source§

fn clone(&self) -> Opts

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Opts

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Opts

source§

fn default() -> Opts

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Opts

§

impl Send for Opts

§

impl Sync for Opts

§

impl Unpin for Opts

§

impl UnwindSafe for Opts

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.