pub struct Engine { /* private fields */ }Expand description
The core WebAssembly engine for executing components and workloads.
The Engine is responsible for compiling WebAssembly components, managing
their lifecycle, and providing the runtime environment for execution.
It wraps a wasmtime engine with additional functionality for workload management.
Implementations§
Source§impl Engine
impl Engine
Sourcepub fn builder() -> EngineBuilder
pub fn builder() -> EngineBuilder
Creates a new EngineBuilder for configuring an engine.
§Returns
A default EngineBuilder that can be customized with additional configuration.
Sourcepub fn inner(&self) -> &Engine
pub fn inner(&self) -> &Engine
Gets a reference to the inner wasmtime engine.
This provides access to the underlying wasmtime engine for advanced use cases.
§Returns
A reference to the internal wasmtime::Engine.
Sourcepub fn initialize_workload(
&self,
id: impl AsRef<str>,
workload: Workload,
) -> Result<UnresolvedWorkload>
pub fn initialize_workload( &self, id: impl AsRef<str>, workload: Workload, ) -> Result<UnresolvedWorkload>
Initializes a workload by validating and preparing all its components.
This function takes a workload definition and prepares it for execution by:
- Validating service components (if present)
- Setting up volumes (both host path and empty directory types)
- Initializing all components with their resource configurations
§Arguments
id- Unique identifier for this workload instanceworkload- The workload configuration containing components, services, and volumes
§Returns
An UnresolvedWorkload that still needs to be bound to plugins and resolved
before execution.
§Errors
Returns an error if:
- Service component validation fails
- Volume paths don’t exist or aren’t accessible
- Component initialization fails
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Engine
impl !UnwindSafe for Engine
impl Freeze for Engine
impl Send for Engine
impl Sync for Engine
impl Unpin for Engine
impl UnsafeUnpin for Engine
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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