Trait lunatic_process::state::ProcessState
source · pub trait ProcessState: Sized {
type Config: ProcessConfig + Default + Send + Sync;
Show 13 methods
// Required methods
fn new_state(
&self,
module: Arc<WasmtimeCompiledModule<Self>>,
config: Arc<Self::Config>
) -> Result<Self>;
fn register(linker: &mut Linker<Self>) -> Result<()>;
fn initialize(&mut self);
fn is_initialized(&self) -> bool;
fn runtime(&self) -> &WasmtimeRuntime;
fn module(&self) -> &Arc<WasmtimeCompiledModule<Self>>;
fn config(&self) -> &Arc<Self::Config>;
fn id(&self) -> u64;
fn signal_mailbox(&self) -> &(SignalSender, SignalReceiver);
fn message_mailbox(&self) -> &MessageMailbox ⓘ;
fn config_resources(&self) -> &ConfigResources<Self::Config>;
fn config_resources_mut(&mut self) -> &mut ConfigResources<Self::Config>;
fn registry(&self) -> &Arc<RwLock<HashMap<String, (u64, u64)>>>;
}
Expand description
The internal state of a process.
The ProcessState
has two main roles:
- It holds onto all vm resources (file descriptors, tcp streams, channels, …)
- Registers all host functions working on those resources to the
Linker
Required Associated Types§
Required Methods§
fn new_state( &self, module: Arc<WasmtimeCompiledModule<Self>>, config: Arc<Self::Config> ) -> Result<Self>
sourcefn register(linker: &mut Linker<Self>) -> Result<()>
fn register(linker: &mut Linker<Self>) -> Result<()>
Register all host functions to the linker.
sourcefn initialize(&mut self)
fn initialize(&mut self)
Marks a wasm instance as initialized
sourcefn is_initialized(&self) -> bool
fn is_initialized(&self) -> bool
Returns true if the instance was initialized
sourcefn runtime(&self) -> &WasmtimeRuntime
fn runtime(&self) -> &WasmtimeRuntime
Returns the WebAssembly runtime