Skip to main content

apimock_server/
lib.rs

1//! HTTP(S) server runtime for apimock.
2//!
3//! # Responsibilities
4//!
5//! - Listener binding and the accept loop (HTTP + HTTPS).
6//! - Per-request dispatch (OPTIONS / middleware / rule sets / dyn_route).
7//! - Compiling Rhai middlewares from paths recorded in config.
8//! - Building `hyper::Response` values from a matched `Respond`.
9//!
10//! # What is deliberately *not* here
11//!
12//! - Rule-set *matching logic*. That's `apimock-routing`.
13//! - Config parsing / validation. That's `apimock-config`.
14//! - Server restart policy. The brief is explicit (ยง7): a running
15//!   server does not restart itself. It may emit [`ReloadHint`]; an
16//!   external control layer decides what to do.
17
18pub mod constant;
19pub mod control;
20pub mod dyn_route;
21pub mod error;
22pub mod http_util;
23pub mod json_path_util;
24pub mod middleware;
25pub mod parsed_request;
26pub mod respond_response;
27pub mod respond_util;
28pub mod response;
29pub mod response_handler;
30pub mod server;
31pub mod tls;
32pub mod types;
33
34pub use control::{ReloadHint, ServerControl, ServerHandle, ServerState};
35pub use error::{ServerError, ServerResult, TlsKind};
36pub use middleware::{LoadedMiddlewares, MiddlewareHandler};
37pub use server::{AppState, Server, service};