Skip to main content

Module runtime_services

Module runtime_services 

Source
Expand description

§Shared environment bundle for all protocol participants

One struct — RuntimeServices — wraps every environment-dependent trait object that a client or server needs to participate in the protocol: the clock (TimeProvider), the network (TransportFactory), and the PoW engine (ParallelPowGenerator).

Every layer of the crate takes its dependencies through a shared Arc<RuntimeServices> instead of reaching for concrete implementations directly. This is the seam that makes the in-memory integration tests work: swap the TransportFactory for MemTransportFactory, the TimeProvider for a virtual clock, the ParallelPowGenerator for StubParallelPowGenerator, and an entire hashiverse network can run deterministically inside a single test binary.

Structs§

RuntimeServices
The bundle of environment-dependent services that both clients and servers need to participate in the protocol.