wasmtime_wit_bindgen

Struct Opts

source
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: 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.

§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.

Implementations§

source§

impl Opts

source

pub fn generate(&self, resolve: &Resolve, world: WorldId) -> Result<String>

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 Freeze for Opts

§

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 T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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 T
where 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 T
where T: Clone,

source§

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 T
where U: Into<T>,

source§

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 T
where U: TryFrom<T>,

source§

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.