Skip to content

Commit 7fd624c

Browse files
committed
add ffi_util package for FFI related util & add @ffi_util.RawFunction type for capture-free function
1 parent ee138fa commit 7fd624c

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

ffi_util/ffi_util.mbti

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package moonbitlang/core/ffi_util
2+
3+
// Values
4+
5+
// Types and methods
6+
pub type RawFunction
7+
8+
// Type aliases
9+
10+
// Traits
11+

ffi_util/moon.pkg.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

ffi_util/raw_function.mbt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/// A compiler builtin type for raw functions, i.e. functions without any capture.
2+
/// This is useful when passing callbacks to FFI.
3+
/// Here `T` must be a function type in `RawFunction[T]`
4+
pub type RawFunction[T]

0 commit comments

Comments
 (0)