pub struct WasmtimeEngineProviderBuilder<'a> { /* private fields */ }
Expand description
Used to build WasmtimeEngineProvider
instances.
Implementations
sourceimpl<'a> WasmtimeEngineProviderBuilder<'a>
impl<'a> WasmtimeEngineProviderBuilder<'a>
sourcepub fn new(module_bytes: &'a [u8]) -> Self
pub fn new(module_bytes: &'a [u8]) -> Self
A new WasmtimeEngineProviderBuilder instance, must provide the wasm module to be loaded
sourcepub fn engine(self, engine: Engine) -> Self
pub fn engine(self, engine: Engine) -> Self
Provide a preinitialized wasmtime::Engine
Warning: when used, engine specific options like
cache
and
enable_epoch_interruptions
must be pre-configured by the user. WasmtimeEngineProviderBuilder
won’t be
able to configure them at build
time.
sourcepub fn wasi_params(self, wasi: WasiParams) -> Self
pub fn wasi_params(self, wasi: WasiParams) -> Self
WASI params
sourcepub fn enable_epoch_interruptions(
self,
wapc_init_deadline: u64,
wapc_func_deadline: u64
) -> Self
pub fn enable_epoch_interruptions(
self,
wapc_init_deadline: u64,
wapc_func_deadline: u64
) -> Self
Enable Wasmtime epoch-based interruptions and set the deadlines to be enforced
Two kind of deadlines have to be set:
wapc_init_deadline
: the number of ticks the waPC initialization code can take before the code is interrupted. This is the code usually defined inside of thewapc_init
/_start
functionswapc_func_deadline
: the number of ticks any regular waPC guest function can run before its terminated by the host
Both these limits are expressed using the number of ticks that are allowed before the WebAssembly execution is interrupted. It’s up to the embedder of waPC to define how much time a single tick is granted. This could be 1 second, 10 nanoseconds, or whatever the user prefers.
Warning: when providing an instance of wasmtime::Engine
via the
WasmtimeEngineProvider::engine
helper, ensure the wasmtime::Engine
has been created with the epoch_interruption
feature enabled
sourcepub fn build(&self) -> Result<WasmtimeEngineProvider, Error>
pub fn build(&self) -> Result<WasmtimeEngineProvider, Error>
Create a WasmtimeEngineProvider
instance
Trait Implementations
sourceimpl<'a> Default for WasmtimeEngineProviderBuilder<'a>
impl<'a> Default for WasmtimeEngineProviderBuilder<'a>
sourcefn default() -> WasmtimeEngineProviderBuilder<'a>
fn default() -> WasmtimeEngineProviderBuilder<'a>
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl<'a> !RefUnwindSafe for WasmtimeEngineProviderBuilder<'a>
impl<'a> Send for WasmtimeEngineProviderBuilder<'a>
impl<'a> Sync for WasmtimeEngineProviderBuilder<'a>
impl<'a> Unpin for WasmtimeEngineProviderBuilder<'a>
impl<'a> !UnwindSafe for WasmtimeEngineProviderBuilder<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the self
file descriptor.
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,
Create a new SetFdFlags
value for use with set_fd_flags
. Read more
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
Set the “status” flags for the self
file descriptor. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for Twhere
V: MultiLane<T>,
impl<V, T> VZip<V> for Twhere
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more