pub struct Harness { /* private fields */ }Expand description
A built harness: immutable after build().
Implementations§
Source§impl Harness
impl Harness
pub fn builder() -> HarnessBuilder
pub fn venture(&self) -> &Arc<Venture> ⓘ
pub fn modules(&self) -> &[Arc<dyn Module>]
pub fn templates(&self) -> &Arc<TemplateRegistry> ⓘ
pub fn events(&self) -> &EventBus
Sourcepub fn module_context(
&self,
module: &dyn Module,
ports: &Ports,
) -> ModuleContext
pub fn module_context( &self, module: &dyn Module, ports: &Ports, ) -> ModuleContext
Builds the context a module sees: its declared ports (view), the
config, the shared bus, templates and venture. router() uses this
per module; cratefield-runtime-cloudflare uses it for scheduled
fan-out.
Sourcepub fn runtime(&self) -> Option<&Arc<dyn Runtime>>
pub fn runtime(&self) -> Option<&Arc<dyn Runtime>>
The runtime this harness was validated against, if one was supplied.
Sourcepub fn surface(&self) -> &SurfaceDocument
pub fn surface(&self) -> &SurfaceDocument
The composed UI surface, admin actions included, for tooling
(fz, the control plane). GET /__surface serves the same
document, public subset unless the admin bearer is presented.
Sourcepub fn router(&self, ports: Ports) -> Router
pub fn router(&self, ports: Ports) -> Router
Assembles the full router: each module nested under /v1/<name>,
the one /.well-known router (if any) nested at the root,
GET /__health, GET /__ready, GET /__surface, the UI renderer
at /ui when one is mounted, and the shared middleware
(request-id/Scope, CORS allowlist, 64 KiB body limit, /v1/*
security headers). Nothing but /.well-known, /ui and the
/__* probes is ever mounted at the root.