Add func method to Instance

This commit is contained in:
Lachlan Sneff
2019-01-23 15:30:35 -08:00
parent ab65477d1f
commit bc2e527bb2
4 changed files with 183 additions and 14 deletions

View File

@ -170,10 +170,11 @@ impl Ctx {
}
}
enum InnerFunc {}
/// Used to provide type safety (ish) for passing around function pointers.
/// The typesystem ensures this cannot be dereferenced since an
/// empty enum cannot actually exist.
pub enum Func {}
pub struct Func(InnerFunc);
/// An imported function, which contains the vmctx that owns this function.
#[derive(Debug, Clone)]