pub struct EngineBuilder { /* private fields */ }Expand description
Builder for constructing an Engine with custom configuration.
The builder pattern allows for flexible configuration of the engine before creation. By default, it enables async support which is required for component execution.
Implementations§
Source§impl EngineBuilder
impl EngineBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new EngineBuilder with default configuration.
§Returns
A new builder instance with default wasmtime configuration.
Sourcepub fn with_pooling_allocator(self, enable: bool) -> Self
pub fn with_pooling_allocator(self, enable: bool) -> Self
Enables or disables the pooling allocator for instance allocation.
Sourcepub fn with_config(self, config: Config) -> Self
pub fn with_config(self, config: Config) -> Self
Sets a custom wasmtime configuration for the engine.
This allows full control over the wasmtime engine configuration, including compilation settings, runtime limits, and feature flags.
§Arguments
config- A wasmtimeConfigobject with custom settings
§Returns
The builder instance for method chaining.
Source§impl EngineBuilder
impl EngineBuilder
Sourcepub fn build(self) -> Result<Engine>
pub fn build(self) -> Result<Engine>
Builds and returns a configured Engine.
This method finalizes the configuration and creates the engine. It automatically enables async support which is required for component execution.
§Returns
A new Engine instance configured with the builder’s settings.
§Errors
Returns an error if the wasmtime engine creation fails.
Trait Implementations§
Source§impl Default for EngineBuilder
impl Default for EngineBuilder
Source§fn default() -> EngineBuilder
fn default() -> EngineBuilder
Auto Trait Implementations§
impl !RefUnwindSafe for EngineBuilder
impl !UnwindSafe for EngineBuilder
impl Freeze for EngineBuilder
impl Send for EngineBuilder
impl Sync for EngineBuilder
impl Unpin for EngineBuilder
impl UnsafeUnpin for EngineBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
self file descriptor. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more