Enum linera_execution::WasmService
source · pub enum WasmService {
Wasmer {
module: Arc<Module>,
},
}Expand description
A user service in a compiled WebAssembly module.
Variants§
Implementations§
source§impl WasmService
impl WasmService
sourcepub async fn new_with_wasmer(
service_bytecode: Bytecode
) -> Result<Self, WasmExecutionError>
pub async fn new_with_wasmer( service_bytecode: Bytecode ) -> Result<Self, WasmExecutionError>
Creates a new WasmService using Wasmer with the provided bytecodes.
sourcepub fn prepare_service_runtime_with_wasmer(
service_module: &Module,
runtime: UnboundedSender<ServiceRequest>
) -> Result<WasmRuntimeContext<Service>, WasmExecutionError>
pub fn prepare_service_runtime_with_wasmer( service_module: &Module, runtime: UnboundedSender<ServiceRequest> ) -> Result<WasmRuntimeContext<Service>, WasmExecutionError>
Prepares a runtime instance to call into the Wasm service.
source§impl WasmService
impl WasmService
sourcepub async fn new(
service_bytecode: Bytecode,
runtime: WasmRuntime
) -> Result<Self, WasmExecutionError>
pub async fn new( service_bytecode: Bytecode, runtime: WasmRuntime ) -> Result<Self, WasmExecutionError>
Creates a new WasmService using the WebAssembly module with the provided bytecodes.
sourcepub async fn from_file(
service_bytecode_file: impl AsRef<Path>,
runtime: WasmRuntime
) -> Result<Self, WasmExecutionError>
pub async fn from_file( service_bytecode_file: impl AsRef<Path>, runtime: WasmRuntime ) -> Result<Self, WasmExecutionError>
Creates a new WasmService using the WebAssembly module in bytecode_file.
Trait Implementations§
source§impl UserService for WasmService
impl UserService for WasmService
source§fn handle_query<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
context: &'life1 QueryContext,
runtime: &'life2 dyn ServiceRuntime,
argument: &'life3 [u8]
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, ExecutionError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn handle_query<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, context: &'life1 QueryContext, runtime: &'life2 dyn ServiceRuntime, argument: &'life3 [u8] ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, ExecutionError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,
Executes unmetered read-only queries on the state of this application.
Auto Trait Implementations§
impl RefUnwindSafe for WasmService
impl Send for WasmService
impl Sync for WasmService
impl Unpin for WasmService
impl UnwindSafe for WasmService
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Mutably borrows from an owned value. Read more
§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,
§fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
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>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Upcastable for Twhere
T: Any + Send + Sync + 'static,
impl<T> Upcastable for Twhere T: Any + Send + Sync + 'static,
§fn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
§fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref
§fn upcast_any_box(self: Box<T>) -> Box<dyn Any>
fn upcast_any_box(self: Box<T>) -> Box<dyn Any>
upcast boxed dyn