pub struct Environment { /* private fields */ }

Implementations

Spawns a new wasm process from a compiled module.

A Process is created from a module, entry function, array of arguments and config. The configuration will define some characteristics of the process, such as maximum memory, fuel and host function properties (filesystem access, networking, ..).

After it’s spawned the process will keep running in the background. A process can be killed with Signal::Kill signal. If you would like to block until the process is finished you can .await on the returned JoinHandle<()>.

Spawns a process from a closure.

Example:
let env = lunatic_process::env::Environment::new(1);
let _proc = env.spawn(|_this, mailbox| async move {
    // Wait on a message with the tag `27`.
    mailbox.pop(Some(&[27])).await;
    // TODO: Needs to return ExecutionResult. Probably the `new` function will need to be adjusted
    Ok(())
});

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.