Skip to main content

forge_jobs_api/
lib.rs

1//! HTTP API surface for the queue. Mirrors the
2//! `tauri-plugin-queue` command surface — the Tauri plugin will be
3//! refactored to thin wrappers around the same handlers in a
4//! follow-up. See `Cargo.toml` for the design rationale.
5//!
6//! Public surface:
7//! - [`dto`] — request/response shapes shared across the Tauri and
8//!   HTTP transports. Kept as a `pub mod` because callers tend to
9//!   import many DTOs at once and the namespace is the discoverable
10//!   contract.
11//! - [`handlers`] — pure async fns over `&Storage`. Test these
12//!   directly against an in-memory `SQLite`, no router or container
13//!   needed.
14//! - [`build_router`] — Axum router that exposes the handlers as JSON
15//!   endpoints. Mount via `Router::merge(forge_jobs_api::build_router(storage))`.
16//! - [`metrics_render`] — Prometheus text rendering helper.
17//! - [`Error`] — handler errors that map to HTTP status codes via
18//!   [`axum::response::IntoResponse`].
19
20pub mod dto;
21pub mod handlers;
22
23// Small modules — surface is just the named items, demoted to
24// `pub(crate)` so the SemVer surface is the re-exports below.
25#[allow(unreachable_pub)]
26pub(crate) mod error;
27#[allow(unreachable_pub)]
28pub(crate) mod metrics;
29#[allow(unreachable_pub)]
30pub(crate) mod router;
31#[allow(unreachable_pub)]
32pub(crate) mod series;
33
34pub use error::Error;
35pub use metrics::render as metrics_render;
36pub use router::build as build_router;