Expand description
Gateway contracts: the ArclyGateway lifecycle trait and the link-time
descriptor / runtime types the #[Gateway] macro emits.
§Why no dyn ArclyGateway
ArclyGateway uses native async fn in trait — ergonomic, but not
object-safe. We never need a trait object: the #[Gateway] macro generates
monomorphic closures over the concrete gateway type (&'static ChatGateway)
and type-erases them into GatewayRuntime. This mirrors the framework’s
route-thunk pattern and keeps the developer’s trait impl clean.
Structs§
- Gateway
Descriptor - Link-time gateway registration. One is emitted per
#[Gateway]impl and collected viainventory.buildconstructs the gateway (wiring itsInject<T>fields from the frozen container) and assembles the runtime. - Gateway
Runtime - The fully-constructed, ready-to-serve form of a gateway. Produced once at
launch by
GatewayDescriptor::buildand leaked to&'static.
Traits§
- Arcly
Gateway - Connection lifecycle for a real-time gateway.
Type Aliases§
- Lifecycle
Hook - A type-erased lifecycle hook closure (built by the macro over a concrete gateway instance).
- Message
Handler - A type-erased event handler. Receives the originating client and the raw
JSON
datapayload (as borrowed text), returns the handler’sResult.