Trait lunatic_process::state::ProcessState
source · [−]pub trait ProcessState: Sized + Default {
type Config: ProcessConfig + Default + Send + Sync;
Show 13 methods
fn new(
runtime: WasmtimeRuntime,
module: WasmtimeCompiledModule<Self>,
config: Arc<Self::Config>,
registry: Arc<DashMap<String, Arc<dyn Process>>>
) -> 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) -> &WasmtimeCompiledModule<Self>;
fn config(&self) -> &Arc<Self::Config>;
fn id(&self) -> Uuid;
fn signal_mailbox(&self) -> &(Sender<Signal>, Receiver<Signal>);
fn message_mailbox(&self) -> &MessageMailboxⓘNotable traits for &MessageMailboximpl Future for &MessageMailbox type Output = Message;;
fn config_resources(&self) -> &ConfigResources<Self::Config>;
fn config_resources_mut(&mut self) -> &mut ConfigResources<Self::Config>;
fn registry(&self) -> &Arc<DashMap<String, Arc<dyn Process>>>;
}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(
runtime: WasmtimeRuntime,
module: WasmtimeCompiledModule<Self>,
config: Arc<Self::Config>,
registry: Arc<DashMap<String, Arc<dyn Process>>>
) -> Result<Self>
Register all host functions to the linker.
fn initialize(&mut self)
fn initialize(&mut self)
Marks a wasm instance as initialized
fn is_initialized(&self) -> bool
fn is_initialized(&self) -> bool
Returns true if the instance was initialized
fn runtime(&self) -> &WasmtimeRuntime
fn runtime(&self) -> &WasmtimeRuntime
Returns the WebAssembly runtime