Skip to content

Instantly share code, notes, and snippets.

@rygo6
Created November 26, 2021 10:07
Show Gist options
  • Save rygo6/c1e20c9ce879a5a5e0bde885a0f20230 to your computer and use it in GitHub Desktop.
Save rygo6/c1e20c9ce879a5a5e0bde885a0f20230 to your computer and use it in GitHub Desktop.
Rust WasmTime Problem.
struct Atype
{
table: Table,
linker: Linker,
}
impl Atype
{
pub fn new() -> Self
{
linker = Linker::load();
linker.add_func_cal( | x | {
// somehow need to access table from here. But all add_func_call
// on linker must be done before generating the resulting table from linker.
let entry = table.get(x);
} );
linker.add_func_cal( | x, y | {
// will also need to access table from multiples of these closures
let entry = table.get(y);
} );
table = linker.create_table();
Self{ table: Table, linker: Linker}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment