wit-bindgen-cli 0.57.1

CLI tool to generate bindings for WIT documents and the component model.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//@ [lang]
//@ path = 'gen/interface/my/test_/i/stub.mbt'

///|
pub fn take_then_drop(x : @ffi.FutureReader[String]) -> Unit {
  let _ = x.drop()
}

///|
pub async fn read_and_drop(
  x : @ffi.FutureReader[String],
) -> Unit noraise {
  let task = @ffi.current_task()
  let _ = task.spawn(fn() {
    let _ = x.read() catch { _ => raise @ffi.Cancelled::Cancelled }
  })
}