# How `include/cotton_ffi.h` is generated. Read by `tests/header.rs`, which is # also the drift guard: `cargo test -p cotton-ffi` regenerates and compares. # # `item_types = ["functions"]` on purpose. The ONLY thing this header declares is # the six-function ABI; `CottonHandle` is opaque to C and its typedef is written # by hand in the `header` below, because a C caller must never be able to reach # inside a Rust `struct` that owns a tokio runtime. language = "C" style = "type" cpp_compat = true no_includes = true include_guard = "COTTON_FFI_H" documentation = true documentation_style = "doxy" header = """ /* * GENERATED from `src/ffi.rs` by `tests/header.rs` (cbindgen) — do not edit by * hand. Run `pnpm gen:ffi`; `cargo test -p * cotton-ffi` fails the build when this file and the source drift. * * The ABI is six functions and stays six for the life of the app: every * capability is a method NAME inside `cotton_call`, so adding one never touches * this file, the module map or the build. */ """ # INSIDE the include guard, unlike `header`: a typedef emitted above the guard # would be repeated on a second `#include` of this file. after_includes = """ /** The open core. Opaque: a C caller holds the pointer and nothing else. */ typedef struct CottonHandle CottonHandle; """ [export] item_types = ["functions"] [fn] sort_by = "None"