#[shared_fn]Expand description
shared_fn is used to define a function that will be exported by a plugin but is not directly
callable by an Extism runtime. These functions can be used for runtime linking and mocking host
functions for tests. If direct access to Wasm native parameters is needed, then a bare
extern "C" fn should be used instead.
All arguments should implement extism_pdk::ToBytes and the return value should implement
extism_pdk::FromBytes, if () or SharedFnResult<()> then no value will be returned.
ยงExample
use extism_pdk::{SharedFnResult, shared_fn};
#[shared_fn]
pub fn greet2(greeting: String, name: String) -> SharedFnResult<String> {
let s = format!("{greeting}, {name}");
Ok(name)
}