server-less-core 0.5.0

Core traits and types for server-less derive macros
Documentation

server-less-core

crates.io docs.rs License

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-less facade. Reach for it directly only when you're writing code that interoperates with generated output at the trait level.

What's inside

  • Error modelErrorCode and the IntoErrorCode trait, plus ErrorResponse, HttpStatusHelper, and HttpStatusFallback. 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 Context extractor (and WsSender for WebSocket) used to pass request-scoped state into your methods.
  • CLI manual & outputCliManualNode and the cli_manual_to_json / cli_manual_to_text helpers that build the whole-tree --manual reference surface, plus cli_format_output for --json / --jq formatting.
  • Mount & dispatch traitsCliSubcommand, McpNamespace, JsonRpcMount, WsMount, and HttpMount for composing nested subcommands and routers.
  • Inference primitivesMethodInfo, 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.