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§

source

fn new_state( &self, module: Arc<WasmtimeCompiledModule<Self>>, config: Arc<Self::Config> ) -> Result<Self>

source

fn register(linker: &mut Linker<Self>) -> Result<()>

Register all host functions to the linker.

source

fn initialize(&mut self)

Marks a wasm instance as initialized

source

fn is_initialized(&self) -> bool

Returns true if the instance was initialized

source

fn runtime(&self) -> &WasmtimeRuntime

Returns the WebAssembly runtime

source

fn module(&self) -> &Arc<WasmtimeCompiledModule<Self>>

source

fn config(&self) -> &Arc<Self::Config>

Returns the process configuration

source

fn id(&self) -> u64

source

fn signal_mailbox(&self) -> &(SignalSender, SignalReceiver)

source

fn message_mailbox(&self) -> &MessageMailbox

source

fn config_resources(&self) -> &ConfigResources<Self::Config>

source

fn config_resources_mut(&mut self) -> &mut ConfigResources<Self::Config>

source

fn registry(&self) -> &Arc<RwLock<HashMap<String, (u64, u64)>>>

Implementors§