pub struct WasmHostState {Show 13 fields
pub config: Arc<RwLock<AppConfig>>,
pub pipeline: SharedPipeline,
pub runtime_handle: Handle,
pub process_manager: Arc<ProcessManager>,
pub vkey_store: Arc<VirtualKeyStore>,
pub kv_store: Arc<Mutex<HashMap<String, String>>>,
pub caller_package_name: String,
pub package_dir: String,
pub permissions: PackagePermissions,
pub package_map: PackageMap,
pub package_aliases: Arc<Mutex<HashMap<String, String>>>,
pub call_depth: Arc<Mutex<u32>>,
pub app_state: Arc<Mutex<Option<AppState>>>,
}Expand description
State shared across all WASM packages via Extism host functions.
Each package instance gets its own clone with a unique caller_package_name.
Shared resources (kv_store, package_map, etc.) are behind Arc so clones share them.
Fields§
§config: Arc<RwLock<AppConfig>>§pipeline: SharedPipeline§runtime_handle: Handle§process_manager: Arc<ProcessManager>§vkey_store: Arc<VirtualKeyStore>§kv_store: Arc<Mutex<HashMap<String, String>>>§caller_package_name: StringName of the package that owns this UserData instance.
package_dir: StringFilesystem directory the owning package was loaded from (official/ or
installed/ — whichever the index resolved). Exposed to the guest as the
WEFT_PACKAGE_DIR env var so package resources (skills/, mcp/, assets/)
can be located relative to the package rather than a hardcoded repo path.
permissions: PackagePermissionsPermissions declared by the owning package’s manifest ([permissions] in package.toml).
package_map: PackageMapDirect access to all loaded plugins for cross-package calls.
package_aliases: Arc<Mutex<HashMap<String, String>>>§call_depth: Arc<Mutex<u32>>Call depth counter to prevent infinite recursion in cross-package calls.
app_state: Arc<Mutex<Option<AppState>>>Trait Implementations§
Source§impl Clone for WasmHostState
impl Clone for WasmHostState
Source§fn clone(&self) -> WasmHostState
fn clone(&self) -> WasmHostState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for WasmHostState
impl !UnwindSafe for WasmHostState
impl Freeze for WasmHostState
impl Send for WasmHostState
impl Sync for WasmHostState
impl Unpin for WasmHostState
impl UnsafeUnpin for WasmHostState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: Sized + AsFilelike,
self file descriptor. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more