el-ffi — host bindings for the Rust core (ADR-001, ADR-009, ADR-010).
One Rust API surface exported three ways:
React Native — uniffi-bindgen-react-native (ADR-001)
#[derive(uniffi::Object)] + #[uniffi::export] → TypeScript + JSI C++ +
Turbo Module. Streaming via StreamHandler callback interface (UniFFI
cannot export impl FnMut parameters).
Flutter — flutter_rust_bridge v2 (ADR-009)
#[frb(opaque)] on EdgeLlm → Dart opaque handle. ask() →
Future<String>, ask_stream() (closure variant) → Stream<String>.
FRB v2 handles impl FnMut natively.
Web / npm — wasm-bindgen (ADR-001)
#[wasm_bindgen] on both the struct and the impl block → ESM TypeScript
package via wasm-pack. The struct annotation is required: without it
wasm-bindgen cannot satisfy IntoWasmAbi/WasmDescribe for the impl block.
Web limitations: the local path uses a dev-stage echo placeholder until
Candle-on-wasm is wired, and the cloud backend is not available on web
(ADR-010 amendment): el-cloud's blocking HTTP transport has no wasm
implementation, so EdgeLlm.cloud throws an explicit error there instead
of silently degrading.