server-less-core
Runtime support crate for server-less — the foundational traits and types that the derive macros generate against.
Most users don't depend on this directly. It's pulled in transitively when you depend on the
server-lessfacade. Reach for it directly only when you're writing code that interoperates with generated output at the trait level.
What's inside
- Error model —
ErrorCodeand theIntoErrorCodetrait, plusErrorResponse,HttpStatusHelper, andHttpStatusFallback. These back#[derive(ServerlessError)]and give every protocol projection a consistent way to map errors to HTTP statuses, exit codes, gRPC codes, and JSON-RPC codes. - Context extraction — the
Contextextractor (andWsSenderfor WebSocket) used to pass request-scoped state into your methods. - CLI manual & output —
CliManualNodeand thecli_manual_to_json/cli_manual_to_texthelpers that build the whole-tree--manualreference surface, pluscli_format_outputfor--json/--jqformatting. - Mount & dispatch traits —
CliSubcommand,McpNamespace,JsonRpcMount,WsMount, andHttpMountfor composing nested subcommands and routers. - Inference primitives —
MethodInfo,ParamInfo,HttpMethod, and path inference shared across projections. - Config module — runtime support for
#[derive(Config)](TOML + environment layering).
Features
| Feature | Enables |
|---|---|
cli |
CLI output formatting (--json / --jq) and manual helpers (clap, jaq) |
config |
Config loading support (TOML) |
http |
HTTP mount trait + OpenAPI types (axum) |
ws |
WebSocket support (futures, tokio, axum) |
mcp |
MCP namespace trait |
jsonrpc |
JSON-RPC mount trait |
jsonschema |
JSON Schema generation (schemars) |
These mirror the corresponding features on the server-less facade and are normally selected for you by it.
Documentation
See the CHANGELOG.
License
MIT — see LICENSE.
Part of RHI.