cufflink-fn 0.8.2

Write custom Cufflink handlers in Rust — compiles to WASM
Documentation

cufflink-fn

Write custom Cufflink handlers in Rust that compile to WASM.

This crate wraps the raw WASM host ABI so you write normal Rust code instead of pointer manipulation. Use it with cufflink services running in WASM mode.

Quick Start

use cufflink_fn::prelude::*;

cufflink_fn::init!();

handler!(hello, |req: Request| {
    let name = req.body()["name"].as_str().unwrap_or("world");
    Response::json(&json!({"message": format!("Hello, {}!", name)}))
});

Architecture

Organize your code in layers:

  • Handlers (thin) — parse request, call operation, return response
  • Operations (fat) — validation, business rules, orchestration
  • Repos (data) — pure SQL via [db::query] / [db::execute]