Skip to main content

Crate citum_server

Crate citum_server 

Source
Expand description

Citum JSON-RPC server.

citum-server runs citum-engine behind a process boundary for clients that need a standalone renderer instead of linking the engine directly. The crate supports stdio JSON-RPC in every build and an axum HTTP transport through the default-on http feature. Both transports expose the same JSON-RPC method surface; only the framing changes.

§Methods

MethodRequired paramsOptional paramsResult
render_citationstyle_path, refs, citationoutput_format, inject_ast_indicesrendered citation string
render_bibliographystyle_path, refsoutput_format, inject_ast_indicesrendered bibliography object
validate_stylestyle_pathnonevalidation object
format_documentstyle, refs, citationsoutput_format, locale, document_options{formatted_citations, bibliography, warnings}

refs in render_citation and render_bibliography is an inline JSON map of native Citum reference objects. refs in format_document accepts citum-engine’s tagged citum_engine::RefsInput shape, including local bibliography paths, inline YAML, inline JSON, and legacy bare JSON maps. Dates are EDTF strings such as "1988", not CSL-JSON date-parts objects.

render_citation, render_bibliography, and validate_style accept style_path, a string path to a local Citum YAML style. format_document accepts the richer style object, for example { "kind": "path", "value": "styles/embedded/apa-7th.yaml" }.

See rpc for the request envelope and stdio transport details. See http for the default HTTP transport.

§Features

  • async: Tokio runtime support used by HTTP transport.
  • http: axum HTTP transport; enabled by default and implies async.
  • schema: /rpc/schema plus schema derivations.
  • schema-types: schema derivations without the HTTP schema endpoint.

Re-exports§

pub use error::ServerError;
pub use rpc::dispatch;

Modules§

error
Server error types and conversions.
http
Default HTTP transport built on axum. Default HTTP transport for the JSON-RPC server.
rpc
JSON-RPC request handling and stdio transport. JSON-RPC request handling for the stdio transport.