Skip to main content

Crate apimock_server

Crate apimock_server 

Source
Expand description

HTTP(S) server runtime for apimock.

§Responsibilities

  • Listener binding and the accept loop (HTTP + HTTPS).
  • Per-request dispatch (OPTIONS / middleware / rule sets / dyn_route).
  • Compiling Rhai middlewares from paths recorded in config.
  • Building hyper::Response values from a matched Respond.

§What is deliberately not here

  • Rule-set matching logic. That’s apimock-routing.
  • Config parsing / validation. That’s apimock-config.
  • Server restart policy. The brief is explicit (§7): a running server does not restart itself. It may emit ReloadHint; an external control layer decides what to do.

Re-exports§

pub use control::ReloadHint;
pub use control::ServerControl;
pub use control::ServerHandle;
pub use control::ServerState;
pub use error::ServerError;
pub use error::ServerResult;
pub use error::TlsKind;
pub use middleware::LoadedMiddlewares;
pub use middleware::MiddlewareHandler;
pub use server::AppState;
pub use server::Server;
pub use server::service;

Modules§

constant
control
Stage-1 control/introspection API for the server.
dyn_route
error
Errors produced by server-level operations.
http_util
HTTP utilities used only by the server crate.
json_path_util
Filesystem helpers for resolving URL paths onto JSON-compatible files.
middleware
Compiled Rhai middlewares.
parsed_request
Server-side helpers for apimock_routing::ParsedRequest.
respond_response
Turn a matched Respond declaration into an HTTP response.
respond_util
response
response_handler
server
HTTP(S) server runtime.
tls
types