Skip to main content

Module server

Module server 

Source
Expand description

HTTP(S) server runtime.

§5.0 layout

The Server struct holds the listener addresses and the shared application state. AppState in turn holds a Config (editable declarative data from apimock-config) alongside LoadedMiddlewares (compiled Rhai — runtime only, server-owned).

Dispatch methods (middleware_response, rule_set_response) used to hang off ServiceConfig but were moved here in 5.0 because they build hyper::Response values, which a config crate must not do. They are now free functions in this module that take borrowed config

  • loaded state and produce an hyper::Response.

Re-exports§

pub use crate::control::ReloadHint;
pub use crate::control::ServerControl;
pub use crate::control::ServerHandle;
pub use crate::control::ServerState;

Structs§

AppState
Shared state cloned into each per-request task.
Server
HTTP(S) server.

Functions§

service
Entry point for each HTTP request.