Struct lunatic::Module [−][src]
pub struct Module { /* fields omitted */ }
Expand description
A compiled instance of a WebAssembly module.
Modules belong to Environments
and processes spawned from the modules will
have characteristics defined by the Environment
.
Creating a module will also JIT compile it, this can be a compute intensive tasks.
Implementations
Spawn a new process and use function
as the entry point. If the function takes arguments
the passed in params
need to exactly match their types.
pub fn spawn_link<T, P, M>(
&self,
mailbox: M,
function: &str,
params: &[Param]
) -> Result<(Process<T>, LinkMailbox<P>), LunaticError> where
T: Serialize + DeserializeOwned,
P: Serialize + DeserializeOwned,
M: TransformMailbox<P>,
pub fn spawn_link<T, P, M>(
&self,
mailbox: M,
function: &str,
params: &[Param]
) -> Result<(Process<T>, LinkMailbox<P>), LunaticError> where
T: Serialize + DeserializeOwned,
P: Serialize + DeserializeOwned,
M: TransformMailbox<P>,
Spawn a new process and link it to the current one.