Skip to main content

Module wire

Module wire 

Source
Expand description

HTTP wire protocol: the request and response bodies mdcast-server and mdcast-client exchange. Types only — no transport, no handler logic.

The shape of the exchange:

  1. The client posts a render request (RenderMarkdownRequest or RenderTemplateRequest) whose crate::AssetManifest names the assets the render needs, by digest — never inline bytes.
  2. If the server holds every digest, it renders and answers with the artifact bytes.
  3. If it does not, it answers 409 Conflict with a MissingBlobsError; the client uploads those blobs and retries. BlobCheckRequest/BlobCheckResponse let a client skip a doomed render round-trip and ask up front.
  4. Any other failure answers with an ErrorResponse.

Separately, GET /v1/capabilities (CapabilitiesResponse) is an unauthenticated, cacheable read of deployment shape — which targets and template formats this instance can actually produce, and its upload size ceiling — so a client can feature-gate its UI before attempting any of the above.

Re-exports§

pub use blob::BlobCheckRequest;
pub use blob::BlobCheckResponse;
pub use blob::MissingBlob;
pub use blob::MissingBlobsError;
pub use capabilities::CapabilitiesResponse;
pub use error::ErrorCode;
pub use error::ErrorResponse;
pub use generated::BoardOptions;
pub use generated::BoardTheme;
pub use generated::GeneratedAsset;
pub use generated::GeneratedSpec;
pub use generated::Generator;
pub use generated::QrEcLevel;
pub use render::RenderMarkdownRequest;
pub use render::RenderOptions;
pub use render::RenderTemplateRequest;
pub use render::TemplateFormat;

Modules§

blob
Blob negotiation: the exchange that keeps asset bytes off the render request. A client asks which digests the server is missing, uploads only those, and renders.
capabilities
GET /v1/capabilities response body (issue #81) — deployment shape a client can use to feature-gate its UI before it has even wired up credentials, since the route sits outside the bearer gate.
error
The generic error body every 4xx/5xx other than 409 Conflict carries. 409 has its own shape (crate::MissingBlobsError) because a client acts on it rather than reporting it.
generated
Server-side generated images — QR codes and chess boards — that a template render asks for by content instead of uploading as a blob.
render
Render request bodies — one per entry point mdcast exposes: the markdown pipeline (mdcast render) and the data-driven typst template pipeline (mdcast render-template).