Trait ayaka_plugin::Linker
source · pub trait Linker<M: RawModule>: Sized {
// Required methods
fn new() -> Result<Self>;
fn create(&self, binary: &[u8]) -> Result<M>;
fn import(
&mut self,
ns: impl Into<String>,
funcs: HashMap<String, M::Func>
) -> Result<()>;
fn wrap_raw(
&self,
f: impl Fn(M::LinkerHandle<'_>, i32, i32) -> Result<Vec<u8>> + Send + Sync + 'static
) -> M::Func;
// Provided methods
fn wrap<P: DeserializeOwned + Tuple, R: Serialize>(
&self,
f: impl Fn(P) -> Result<R> + Send + Sync + 'static
) -> M::Func { ... }
fn wrap_with<P: DeserializeOwned + Tuple, R: Serialize>(
&self,
f: impl Fn(M::LinkerHandle<'_>, P) -> Result<R> + Send + Sync + 'static
) -> M::Func { ... }
}Expand description
Represents the linker of plugin modules.