pub struct EngineBuilder<T> { /* private fields */ }
Expand description

A builder interface for configuring a new Engine.

A new EngineBuilder can be obtained with Engine::builder.

Implementations§

Adds definition(s) to the built Engine.

This method’s signature is meant to be used with wit-bindgen’s generated add_to_linker functions, e.g.:

wit_bindgen_wasmtime::import!({paths: ["my-interface.wit"], async: *});
// ...
let mut builder: EngineBuilder<my_interface::MyInterfaceData> = Engine::builder();
builder.link_import(my_interface::MyInterface::add_to_linker)?;

Adds a HostComponent to the built Engine.

Returns a HostComponentDataHandle which can be passed to HostComponentsData to access or set associated HostComponent::Data for an instance.

Sets the epoch tick internal for the built Engine.

This is used by Store::set_deadline to calculate the number of “ticks” for epoch interruption, and by the default epoch ticker thread. The default is DEFAULT_EPOCH_TICK_INTERVAL.

See EngineBuilder::epoch_ticker_thread and wasmtime::Config::epoch_interruption.

Configures whether the epoch ticker thread will be spawned when this Engine is built.

Enabled by default; if disabled, the user must arrange to call engine.as_ref().increment_epoch() every epoch_tick_interval or interrupt-based features like Store::set_deadline will not work.

Builds an Engine from this builder with the given host state data.

Note that this data will generally go entirely unused, but is needed by the implementation of Engine::instantiate_pre. If T: Default, it is probably preferable to use EngineBuilder::build.

Builds an Engine from this builder.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Query the “status” flags for the self file descriptor.
Create a new SetFdFlags value for use with set_fd_flags. Read more
Set the “status” flags for the self file descriptor. Read more
Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more