Trait wasmer::Engine [−][src]
pub trait Engine: MemoryUsage { fn target(&self) -> &Target; fn register_signature(
&self,
func_type: &FunctionType
) -> VMSharedSignatureIndex; fn register_function_metadata(
&self,
func_data: VMCallerCheckedAnyfunc
) -> VMFuncRef; fn lookup_signature(
&self,
sig: VMSharedSignatureIndex
) -> Option<FunctionType>; fn validate(&self, binary: &[u8]) -> Result<(), CompileError>; fn compile(
&self,
binary: &[u8],
tunables: &dyn Tunables
) -> Result<Arc<dyn Artifact + 'static>, CompileError>; unsafe fn deserialize(
&self,
bytes: &[u8]
) -> Result<Arc<dyn Artifact + 'static>, DeserializeError>; fn id(&self) -> &EngineId; fn cloned(&self) -> Arc<dyn Engine + 'static + Sync + Send>; unsafe fn deserialize_from_file(
&self,
file_ref: &Path
) -> Result<Arc<dyn Artifact + 'static>, DeserializeError> { ... } }
Expand description
A unimplemented Wasmer Engine
.
This trait is used by implementors to implement custom engines such as: Universal or Native.
The product that an Engine
produces and consumes is the Artifact
.
Required methods
fn register_signature(&self, func_type: &FunctionType) -> VMSharedSignatureIndex
[src]
fn register_signature(&self, func_type: &FunctionType) -> VMSharedSignatureIndex
[src]Register a signature
fn register_function_metadata(
&self,
func_data: VMCallerCheckedAnyfunc
) -> VMFuncRef
[src]
fn register_function_metadata(
&self,
func_data: VMCallerCheckedAnyfunc
) -> VMFuncRef
[src]Register a function’s data.
fn lookup_signature(&self, sig: VMSharedSignatureIndex) -> Option<FunctionType>
[src]
fn lookup_signature(&self, sig: VMSharedSignatureIndex) -> Option<FunctionType>
[src]Lookup a signature
fn compile(
&self,
binary: &[u8],
tunables: &dyn Tunables
) -> Result<Arc<dyn Artifact + 'static>, CompileError>
[src]
fn compile(
&self,
binary: &[u8],
tunables: &dyn Tunables
) -> Result<Arc<dyn Artifact + 'static>, CompileError>
[src]Compile a WebAssembly binary
unsafe fn deserialize(
&self,
bytes: &[u8]
) -> Result<Arc<dyn Artifact + 'static>, DeserializeError>
[src]
unsafe fn deserialize(
&self,
bytes: &[u8]
) -> Result<Arc<dyn Artifact + 'static>, DeserializeError>
[src]Deserializes a WebAssembly module
Safety
The serialized content must represent a serialized WebAssembly module.
Provided methods
unsafe fn deserialize_from_file(
&self,
file_ref: &Path
) -> Result<Arc<dyn Artifact + 'static>, DeserializeError>
[src]
unsafe fn deserialize_from_file(
&self,
file_ref: &Path
) -> Result<Arc<dyn Artifact + 'static>, DeserializeError>
[src]Deserializes a WebAssembly module from a path
Safety
The file’s content must represent a serialized WebAssembly module.
Implementors
impl Engine for UniversalEngine
[src]
impl Engine for UniversalEngine
[src]pub fn register_signature(
&self,
func_type: &FunctionType
) -> VMSharedSignatureIndex
[src]
pub fn register_signature(
&self,
func_type: &FunctionType
) -> VMSharedSignatureIndex
[src]Register a signature
pub fn lookup_signature(
&self,
sig: VMSharedSignatureIndex
) -> Option<FunctionType>
[src]
pub fn lookup_signature(
&self,
sig: VMSharedSignatureIndex
) -> Option<FunctionType>
[src]Lookup a signature
pub fn validate(&self, binary: &[u8]) -> Result<(), CompileError>
[src]
pub fn validate(&self, binary: &[u8]) -> Result<(), CompileError>
[src]Validates a WebAssembly module
pub fn compile(
&self,
binary: &[u8],
tunables: &dyn Tunables
) -> Result<Arc<dyn Artifact + 'static>, CompileError>
[src]
pub fn compile(
&self,
binary: &[u8],
tunables: &dyn Tunables
) -> Result<Arc<dyn Artifact + 'static>, CompileError>
[src]Compile a WebAssembly binary
pub unsafe fn deserialize(
&self,
bytes: &[u8]
) -> Result<Arc<dyn Artifact + 'static>, DeserializeError>
[src]
pub unsafe fn deserialize(
&self,
bytes: &[u8]
) -> Result<Arc<dyn Artifact + 'static>, DeserializeError>
[src]Deserializes a WebAssembly module
pub fn register_function_metadata(
&self,
func_data: VMCallerCheckedAnyfunc
) -> VMFuncRef
[src]
&self,
func_data: VMCallerCheckedAnyfunc
) -> VMFuncRef