pub struct WasmtimeBatchComponent { /* private fields */ }Expand description
Wasmtime component prepared for Pureflow batch execution.
Implementations§
Source§impl WasmtimeBatchComponent
impl WasmtimeBatchComponent
Sourcepub fn from_component_bytes(bytes: impl AsRef<[u8]>) -> Result<Self>
pub fn from_component_bytes(bytes: impl AsRef<[u8]>) -> Result<Self>
Compile a guest component from bytes.
§Errors
Returns an error if Wasmtime cannot configure the engine or compile the supplied component bytes.
Sourcepub fn from_component_bytes_with_limits(
bytes: impl AsRef<[u8]>,
limits: WasmtimeExecutionLimits,
) -> Result<Self>
pub fn from_component_bytes_with_limits( bytes: impl AsRef<[u8]>, limits: WasmtimeExecutionLimits, ) -> Result<Self>
Compile a guest component from bytes with explicit execution limits.
§Errors
Returns an error if Wasmtime cannot configure the engine or compile the supplied component bytes.
Sourcepub fn from_component_bytes_with_capabilities(
bytes: impl AsRef<[u8]>,
capabilities: &NodeCapabilities,
) -> Result<Self>
pub fn from_component_bytes_with_capabilities( bytes: impl AsRef<[u8]>, capabilities: &NodeCapabilities, ) -> Result<Self>
Compile a guest component after validating the WASM capability boundary.
§Errors
Returns an error if the capability descriptor declares effects that the current import-free WASM world cannot enforce, or if component compilation fails.
Sourcepub fn from_component_bytes_with_capabilities_and_limits(
bytes: impl AsRef<[u8]>,
capabilities: &NodeCapabilities,
limits: WasmtimeExecutionLimits,
) -> Result<Self>
pub fn from_component_bytes_with_capabilities_and_limits( bytes: impl AsRef<[u8]>, capabilities: &NodeCapabilities, limits: WasmtimeExecutionLimits, ) -> Result<Self>
Compile a guest component after validating the WASM capability boundary and applying explicit execution limits.
§Errors
Returns an error if the capability descriptor declares effects that the current import-free WASM world cannot enforce, or if component compilation fails.
Sourcepub const fn limits(&self) -> WasmtimeExecutionLimits
pub const fn limits(&self) -> WasmtimeExecutionLimits
Execution limits used for each guest invocation.
Sourcepub fn invoke(&self, inputs: &BatchInputs) -> Result<BatchOutputs>
pub fn invoke(&self, inputs: &BatchInputs) -> Result<BatchOutputs>
Instantiate and invoke the guest component with one batch.
§Errors
Returns an error if the component cannot instantiate, the guest traps, or the guest returns malformed Pureflow data.
Sourcepub fn invoke_with_cancellation(
&self,
inputs: &BatchInputs,
cancellation: &CancellationToken,
) -> Result<BatchOutputs>
pub fn invoke_with_cancellation( &self, inputs: &BatchInputs, cancellation: &CancellationToken, ) -> Result<BatchOutputs>
Instantiate and invoke the guest component with one batch, interrupting Wasmtime execution if cancellation is requested while the synchronous guest call is in progress.
§Errors
Returns an error if cancellation is already requested, the component cannot instantiate, the guest traps or exceeds its fuel budget, or the guest returns malformed Pureflow data.
Trait Implementations§
Source§impl BatchExecutor for WasmtimeBatchComponent
impl BatchExecutor for WasmtimeBatchComponent
Source§fn invoke(&self, inputs: BatchInputs) -> Result<BatchOutputs>
fn invoke(&self, inputs: BatchInputs) -> Result<BatchOutputs>
Auto Trait Implementations§
impl Freeze for WasmtimeBatchComponent
impl !RefUnwindSafe for WasmtimeBatchComponent
impl Send for WasmtimeBatchComponent
impl Sync for WasmtimeBatchComponent
impl Unpin for WasmtimeBatchComponent
impl UnsafeUnpin for WasmtimeBatchComponent
impl !UnwindSafe for WasmtimeBatchComponent
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Source§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