gsm-core 0.4.31

Core types and platform abstractions for the Greentic messaging runtime.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Wasmtime linker helpers for the Greentic host bindings.
use anyhow::Result;
use greentic_interfaces_host::runner_host_v1;
use wasmtime::component::Linker;

/// Registers the Greentic host imports with the provided Wasmtime linker.
///
/// The store data `T` must implement the generated `HostImports` trait so the linker
/// can call back into your host implementation.
pub fn add_host_imports<T>(linker: &mut Linker<T>) -> Result<()>
where
    T: runner_host_v1::RunnerHost + Send + Sync + 'static,
{
    runner_host_v1::add_to_linker(linker, |host| host).map_err(Into::into)
}