Skip to main content

FunctionBindgenBuilder

Struct FunctionBindgenBuilder 

Source
pub struct FunctionBindgenBuilder<'a, S: State = Empty> { /* private fields */ }
Expand description

Use builder syntax to set the inputs and finish with build().

Implementations§

Source§

impl<'a, S: State> FunctionBindgenBuilder<'a, S>

Source

pub fn build(self) -> FunctionBindgen<'a>
where S: IsComplete,

Finish building and return the requested object

Source

pub fn resource_map( self, value: &'a ResourceMap, ) -> FunctionBindgenBuilder<'a, SetResourceMap<S>>
where S::ResourceMap: IsUnset,

Required.

Mapping of resources for types that have corresponding definitions locally

Source

pub fn clear_resource_borrows( self, value: bool, ) -> FunctionBindgenBuilder<'a, SetClearResourceBorrows<S>>
where S::ClearResourceBorrows: IsUnset,

Required.

Whether current resource borrows need to be deactivated

Source

pub fn intrinsics( self, value: &'a mut BTreeSet<Intrinsic>, ) -> FunctionBindgenBuilder<'a, SetIntrinsics<S>>
where S::Intrinsics: IsUnset,

Required.

Set of intrinsics

Source

pub fn valid_lifting_optimization( self, value: bool, ) -> FunctionBindgenBuilder<'a, SetValidLiftingOptimization<S>>
where S::ValidLiftingOptimization: IsUnset,

Required.

Whether to perform valid lifting optimization

Source

pub fn sizes( self, value: &'a SizeAlign, ) -> FunctionBindgenBuilder<'a, SetSizes<S>>
where S::Sizes: IsUnset,

Required.

Sizes and alignments for sub elements

Source

pub fn err(self, value: ErrHandling) -> FunctionBindgenBuilder<'a, SetErr<S>>
where S::Err: IsUnset,

Required.

Method of error handling

Source

pub fn tmp(self, value: usize) -> FunctionBindgenBuilder<'a, SetTmp<S>>
where S::Tmp: IsUnset,

Required.

Temporary values

Source

pub fn src(self, value: Source) -> FunctionBindgenBuilder<'a, SetSrc<S>>
where S::Src: IsUnset,

Required.

Source code of the function

Source

pub fn block_storage( self, value: Vec<Source>, ) -> FunctionBindgenBuilder<'a, SetBlockStorage<S>>
where S::BlockStorage: IsUnset,

Required.

Block storage

Source

pub fn blocks( self, value: Vec<(String, Vec<String>)>, ) -> FunctionBindgenBuilder<'a, SetBlocks<S>>
where S::Blocks: IsUnset,

Required.

Blocks of the function

Source

pub fn params( self, value: Vec<String>, ) -> FunctionBindgenBuilder<'a, SetParams<S>>
where S::Params: IsUnset,

Required.

Parameters of the function

Source

pub fn memory( self, value: &'a String, ) -> FunctionBindgenBuilder<'a, SetMemory<S>>
where S::Memory: IsUnset,

Optional (Some / Option setters). Memory variable

Source

pub fn maybe_memory( self, value: Option<&'a String>, ) -> FunctionBindgenBuilder<'a, SetMemory<S>>
where S::Memory: IsUnset,

Optional (Some / Option setters). Memory variable

Source

pub fn realloc( self, value: &'a String, ) -> FunctionBindgenBuilder<'a, SetRealloc<S>>
where S::Realloc: IsUnset,

Optional (Some / Option setters). Realloc function name

Source

pub fn maybe_realloc( self, value: Option<&'a String>, ) -> FunctionBindgenBuilder<'a, SetRealloc<S>>
where S::Realloc: IsUnset,

Optional (Some / Option setters). Realloc function name

Source

pub fn post_return( self, value: &'a String, ) -> FunctionBindgenBuilder<'a, SetPostReturn<S>>
where S::PostReturn: IsUnset,

Optional (Some / Option setters). Post return function name

Source

pub fn maybe_post_return( self, value: Option<&'a String>, ) -> FunctionBindgenBuilder<'a, SetPostReturn<S>>
where S::PostReturn: IsUnset,

Optional (Some / Option setters). Post return function name

Source

pub fn tracing_prefix( self, value: &'a String, ) -> FunctionBindgenBuilder<'a, SetTracingPrefix<S>>
where S::TracingPrefix: IsUnset,

Required.

Prefix to use when printing tracing information

Source

pub fn tracing_enabled( self, value: bool, ) -> FunctionBindgenBuilder<'a, SetTracingEnabled<S>>
where S::TracingEnabled: IsUnset,

Required.

Whether tracing is enabled

Source

pub fn encoding( self, value: StringEncoding, ) -> FunctionBindgenBuilder<'a, SetEncoding<S>>
where S::Encoding: IsUnset,

Required.

Method if string encoding

Source

pub fn callee(self, value: &'a str) -> FunctionBindgenBuilder<'a, SetCallee<S>>
where S::Callee: IsUnset,

Required.

Callee of the function

Source

pub fn callee_resource_dynamic( self, value: bool, ) -> FunctionBindgenBuilder<'a, SetCalleeResourceDynamic<S>>
where S::CalleeResourceDynamic: IsUnset,

Required.

Whether the callee is dynamic (i.e. has multiple operands)

Source

pub fn resolve( self, value: &'a Resolve, ) -> FunctionBindgenBuilder<'a, SetResolve<S>>
where S::Resolve: IsUnset,

Required.

The [wit_bindgen::Resolve] containing extracted WIT information

Source

pub fn requires_async_porcelain( self, value: bool, ) -> FunctionBindgenBuilder<'a, SetRequiresAsyncPorcelain<S>>
where S::RequiresAsyncPorcelain: IsUnset,

Required.

Whether the function requires async porcelain

In the case of an import this likely implies the use of JSPI and in the case of an export this is simply code generation metadata.

Source

pub fn is_async(self, value: bool) -> FunctionBindgenBuilder<'a, SetIsAsync<S>>
where S::IsAsync: IsUnset,

Required.

Whether the function is guest async lifted (i.e. WASI P3)

Source

pub fn iface_name( self, value: &'a str, ) -> FunctionBindgenBuilder<'a, SetIfaceName<S>>
where S::IfaceName: IsUnset,

Optional (Some / Option setters). Interface name

Source

pub fn maybe_iface_name( self, value: Option<&'a str>, ) -> FunctionBindgenBuilder<'a, SetIfaceName<S>>
where S::IfaceName: IsUnset,

Optional (Some / Option setters). Interface name

Source

pub fn asmjs(self, value: bool) -> FunctionBindgenBuilder<'a, SetAsmjs<S>>
where S::Asmjs: IsUnset,

Required.

Whether the callee was transpiled from Wasm to JS (asm.js) and thus needs shimming for i64

Source

pub fn component_state( self, value: FunctionBindgenComponentState, ) -> FunctionBindgenBuilder<'a, SetComponentState<S>>
where S::ComponentState: IsUnset,

Optional (Some / Option setters). Component state generated from processing a component.

This information is normally accessible via producing/having access to a wasmtime_environ::component::Component), and is required for some bindgen instructions.

If you are performing bindgen aganist a dummy module, you may omit this field, but if processing has been performed on the component, and this state is available at time of generation for this function, provide this information (normally found in [CanonicalOptions]s)

Source

pub fn maybe_component_state( self, value: Option<FunctionBindgenComponentState>, ) -> FunctionBindgenBuilder<'a, SetComponentState<S>>
where S::ComponentState: IsUnset,

Optional (Some / Option setters). Component state generated from processing a component.

This information is normally accessible via producing/having access to a wasmtime_environ::component::Component), and is required for some bindgen instructions.

If you are performing bindgen aganist a dummy module, you may omit this field, but if processing has been performed on the component, and this state is available at time of generation for this function, provide this information (normally found in [CanonicalOptions]s)

Auto Trait Implementations§

§

impl<'a, S = Empty> !UnwindSafe for FunctionBindgenBuilder<'a, S>

§

impl<'a, S> Freeze for FunctionBindgenBuilder<'a, S>

§

impl<'a, S> RefUnwindSafe for FunctionBindgenBuilder<'a, S>

§

impl<'a, S> Send for FunctionBindgenBuilder<'a, S>

§

impl<'a, S> Sync for FunctionBindgenBuilder<'a, S>

§

impl<'a, S> Unpin for FunctionBindgenBuilder<'a, S>

§

impl<'a, S> UnsafeUnpin for FunctionBindgenBuilder<'a, S>

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