Expand description
§platform-core (Rust port)
Rust port of mercury-composable’s platform-core — the event-driven
foundation layer. Canonical behavior spec: the Java project
(system/platform-core, v4.8.6) — see draft-design-specs/platform-core-port.md.
Increment 1 — configuration management: the resources/ folder
convention, MultiLevelMap composite keys, ConfigReader with ${...}
substitution, and the AppConfigReader base-config singleton.
Increment 2 — event-bus foundation: the immutable EventEnvelope,
the ComposableFunction contract (+ TypedFunction/TypedAdapter),
the Platform registry with per-route worker pools, and the
PostOffice messaging client (send + RPC). Functions are addressed only
by route name and never call each other directly.
Re-exports§
pub use app_starter::AppStarter;pub use app_starter::AutoStart;pub use app_starter::EntryPoint;pub use envelope::EventEnvelope;pub use event_stream::EventStreamWriter;pub use function::AppError;pub use function::ComposableFunction;pub use function::TypedAdapter;pub use function::TypedFunction;pub use graph::MiniGraph;pub use graph::SimpleConnection;pub use graph::SimpleNode;pub use graph::SimpleRelationship;pub use platform::FunctionOptions;pub use platform::Platform;pub use post_office::PostOffice;pub use util::app_config_reader::AppConfigReader;pub use util::config_reader::ConfigError;pub use util::config_reader::ConfigReader;pub use util::managed_cache::CacheValue;pub use util::managed_cache::ManagedCache;pub use util::multi_level_map::ConfigValue;pub use util::multi_level_map::MultiLevelMap;pub use util::overrides;pub use util::resources;pub use inventory;
Modules§
- actuator
- Actuator endpoints — Rust port of the Java
ActuatorServices(org.platformlambda.core.services.ActuatorServices), registered by the lifecycle’s essential-services phase and exposed over REST automation via the default endpoints (/info,/info/routes,/env,/health,/livenessprobe). - app_
starter - Rust port of the Java application lifecycle —
AutoStart+AppStarter(org.platformlambda.core.system) and theEntryPointcontract (org.platformlambda.core.models.EntryPoint). - automation
- REST automation — the HTTP protocol boundary (Rust port of the Java
org.platformlambda.automationpackage, increment-6 core scope; seedraft-design-specs/platform-core-port.md§5e). - envelope
- Rust port of the Java
EventEnvelope(org.platformlambda.core.models.EventEnvelope) — the immutable message container between composable functions. - event_
stream - HTTP response streaming — the producer side of the multi-shot reply route
(Java
EventStreamWriter). - function
- The composable-function contract — Rust port of the Java
LambdaFunction/TypedLambdaFunction<I, O>(org.platformlambda.core.models). - graph
- The minimalist in-memory property graph — Rust port of
org.platformlambda.core.graph.MiniGraph(+SimpleNode,SimpleConnection,SimpleRelationship): nodes with types and untyped properties, unidirectional connections carrying optional typed relations, alias/id/type/property lookups, neighbor traversal and BFS path discovery. Designed for a few hundred nodes held entirely in memory — deliberately never a database (the repo vision’s non-goal); the Active Knowledge Graph layer (layer 3) builds on it. - logging
- Structured logging with the application log context — Rust port of the
Java
LogContextConfig+JsonLogger/CompactAppenderdesign (org.platformlambda.core.logging). - platform
- Rust port of the Java
Platformregistry + the manager-worker dispatch (org.platformlambda.core.system.Platform/ServiceQueue/WorkerHandler). - post_
office - Rust port of the Java
PostOffice(org.platformlambda.core.system.PostOffice) — the inter-function messaging client. - registry
- Link-time registration inventory — the Rust analog of Java’s classpath
annotation scanning (design D6’s ergonomic layer). The attribute macros
(
#[preload],#[before_application],#[main_application]) submit entries here at link time;AutoStartcollects them at startup, exactly as Java’sAppStarterscans for its annotations. - serializer
- Null-transport policy for the wire serializers — the Rust mirror of Java’s
serializer.null.transport(JavaSimpleMapper/Gson for JSON andMsgPackfor the event bus, both reading the same config). - telemetry
- Rust port of the Java
Telemetryservice (org.platformlambda.core.services.Telemetry) — the built-indistributed.tracingfunction, registered by the lifecycle’s essential-services phase (the JavaEssentialServiceLoader). - trace
- Distributed-trace context — Rust port of the Java
TraceInfo+LogContext/LogContextManagerdesign (org.platformlambda.core). - util
- Utility layer of platform-core — configuration management first
(
draft-design-specs/platform-core-port.md, increment 1).
Macros§
- auto_
start_ main - Generate the application
main()— the JavaAutoStart.main(args)one-liner. Expands in the application crate, so the app’s ownresources/folder (next to itsCargo.toml) joins the resource roots:
Attribute Macros§
- before_
application - The Java
@BeforeApplication(sequence)analog: anEntryPointthat runs before functions are registered (validation/compilation work). Lower sequences run first (default 10; 0 is framework-reserved; a failing hook aborts startup). - event_
interceptor - The Java
@EventInterceptoranalog as a first-class marker attribute: the function receives the raw envelope and replies manually; the worker ignores its returned envelope. Order-insensitive — write it above or below#[preload], or inline as#[preload(..., interceptor)]. - main_
application - The Java
@MainApplication(sequence)analog: the application entry point (EntryPoint), run after preload. Lower sequences run first (default 10). - optional_
service - The Java
@OptionalService("condition")analog — a first-class attribute that makes a composable function (#[preload]), a websocket server function (#[websocket_service]), a#[before_application]or a#[main_application]conditional on application configuration: the item registers only when the condition holds at startup (JavaFeature.isRequiredsemantics — comma-separated OR,!keynegation,key=value/key/key=forms, case-insensitive). - preload
- The Java
@PreLoad(route, instances, envInstances)analog: registers a composable function at startup. - websocket_
service - The Java
@WebSocketService(value, namespace)analog: registers a websocket server endpoint declaratively. The annotated struct implementsComposableFunctionand receives the session lifecycle events (type: open/string/bytes/close) on its per-connection{session}.inroute; replies go to thetx_pathgiven in the headers. - zero_
tracing - The Java
@ZeroTracinganalog as a first-class marker attribute: suppresses the function’s own telemetry (no dataset, no span) while the trace context still flows through for continuity. Order-insensitive — Java does not require a stacking order and neither does this port: write it above or below#[preload], or inline as#[preload(..., zero_tracing)].