ulo
ulo
Documentation

Start here

Coming from NestJSNestJS topics, mapped

The model

Protocols

Integrations

Operating

Reference

API ReferenceCrate mapMacrosHandler attributesCore typesErrors and diagnosticsFeatures and environment
API Reference

Crate map

Every crate in the workspace, grouped by role, with its features, MSRV, runtime level and the Ulo crates it depends on.

The workspace has 72 member crates besides the examples. 58 are published and 14 are test-only (publish = false). Of the published crates, 17 release together as the core under one tag and 41 are leaves. Every member inherits its version from [workspace.package], currently 0.1.0-alpha.3, and every internal normal dependency names it exactly, so a published crate resolves no sibling from another release.

The minimum supported Rust version is 1.88, set once in [workspace.package]. Five crates carry a higher floor because a dependency does: ulo-http-salvo 1.92, ulo-graphql-async-graphql 1.89, ulo-db-diesel 1.89, and ulo-db-sqlx and ulo-db-seaorm 1.94. Every other crate keeps 1.88.

The columns:

  • Features lists the crate's own cargo features. default is shown after the semicolon. The feature flags are explained on Features and environment.
  • Runtime level is the level runtime-levels.txt assigns and CI checks against cargo tree. runtime-free means no tokio crate anywhere in the dependency tree, so a plug point is implemented without one. runtime-neutral means tokio's sync arrives through hyper and nothing else of tokio does, so the crate runs on whatever runtime the app is given. runtime-neutral+http2 adds io-util and bytes, which h2 brings. tokio-bound runs on tokio. Two levels listed for one crate are two feature sets checked.
  • Depends on lists only the ulo-* crates among the normal dependencies, including optional ones.

What an application depends on

An application depends on the core, one or more transport crates, one server per transport, and a runtime crate. examples/01-hello is the smallest:

[dependencies]
ulo = { path = "../../crates/ulo" }
ulo-http = { path = "../../crates/ulo-http" }
ulo-http-hyper = { path = "../../crates/ulo-http-hyper" }
ulo-runtime-tokio = { path = "../../crates/ulo-runtime-tokio" }
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }

The macros arrive through the crates that re-export them: ulo re-exports the core attributes, ulo-http the HTTP verbs, ulo-rpc message and event, ulo-ws gateway and message, and ulo-grpc method. A crate that derives Classify or Validate needs no dependency beyond the transport it already uses. An application never depends on a -macros crate directly.

Which server a transport runs on is chosen in main, by the value handed to App::bind: ulo_http_hyper::Server for HTTP, ulo_ws_hyper::Server for a WebSocket gateway on its own port, and a link's server for RPC. An HTTP application embedded in a host that owns the sockets uses an embedding crate (ulo-http-axum, -salvo, -poem, -actix, -rocket) instead.

Layers

LayerCratesDepends on
coreulo, ulo-macros, ulo-handler-codegennothing below it
runtimeulo-runtime-tokio, ulo-runtime-smolthe core
transport hubsulo-transport, ulo-net, ulo-http, ulo-ws, ulo-rpc, ulo-grpc and their macro cratesthe core, and ulo-transport
servers and linksulo-server-hyper, the listeners, ulo-http-hyper, ulo-ws-hyper, the embedding hosts, the RPC linksa hub, and for the hyper servers a listener
integrationsconfig, health, db, graphql, otel, ulo-ws-redisthe core, and a hub where they mount routes
toolingulo-clinothing in the workspace

ulo-transport contains what no single transport owns: FromCall, IntoReply, Classify, CallError, ErrorKind, Details, ExtractError, Valid and Validate, Admission for load shedding, and TaskSet. Each transport crate re-exports the part of it that its handler signatures name, so a type a handler takes or returns is reachable from the crate the application already depends on. scripts/public_reach.py checks that rule in CI.

ulo-handler-codegen is a plain library of syn functions, not a proc-macro crate. Every transport's attribute macro calls it, and a user-written transport's macro crate can too.

ulo-rpc-tcp-core is for link authors, not applications: it is the runtime-free half of the TCP wire that ulo-rpc-tcp and ulo-rpc-tcp-smol share. An application names ulo_rpc_tcp::Tcp or ulo_rpc_tcp_smol::Tcp.

Published crates

Core

CrateRoleFeaturesMSRVRuntime levelDepends on (Ulo crates)
uloThe core: keys, bindings, injection points, scopes, executions, modules, lifecycle, errors, the enhancer traits and TestApp.serde1.88runtime-freeulo-macros
ulo-macros#[injectable], #[controller], #[construct], #[module], #[handlers], #[guards], #[interceptors], #[error_handlers] and #[meta].none1.88runtime-freeulo-handler-codegen
ulo-handler-codegenThe handler protocol every Ulo transport attribute macro is written againstnone1.88runtime-freenone

Runtimes

CrateRoleFeaturesMSRVRuntime levelDepends on (Ulo crates)
ulo-runtime-tokioThe tokio runtime for Ulo: the core's Runtime and Timer, OS shutdown signals and spawn helpersnone1.88tokio-boundulo
ulo-runtime-smolThe smol runtime for Ulo: the core's Runtime on an async-executor Executor and async-io's timersnone1.88runtime-freeulo

Transport hubs and their macros

CrateRoleFeaturesMSRVRuntime levelDepends on (Ulo crates)
ulo-transportTransport-neutral extraction, replies, errors, validation and load shedding for Ulo transportsvalidator1.88runtime-freeulo, ulo-transport-macros
ulo-transport-macrosDerives for Ulo's transport-neutral error and validation traitsnone1.88runtime-freenone
ulo-netEndpoints, socket activation, TLS loading and bound addresses for Ulo transportsnone1.88runtime-freeulo
ulo-httpThe HTTP transport for Ulo: routing, extractors, responses, SSE, pre-dispatch middleware, the backend SPI and the embedding surfacetokio-io1.88runtime-freeulo, ulo-http-macros, ulo-net, ulo-transport
ulo-http-macrosThe HTTP handler attributes for Ulonone1.88runtime-freeulo-handler-codegen
ulo-wsThe WebSocket transport for Ulo: gateways, sessions, rooms and broadcast, on the HTTP server's port or its ownconformance-probe1.88runtime-freeulo, ulo-http, ulo-transport, ulo-ws-macros
ulo-ws-macrosThe WebSocket gateway and message attributes for Ulo, re-exported by ulo-wsnone1.88runtime-freeulo-handler-codegen
ulo-rpcThe RPC transport for Ulo: one frame grammar over TCP, UDP and message brokers, the four call shapes, and the clientconformance-probe1.88runtime-freeulo, ulo-rpc-macros, ulo-transport
ulo-rpc-macrosThe RPC message and event attributes for Ulo, re-exported by ulo-rpcnone1.88runtime-freeulo-handler-codegen
ulo-grpcThe gRPC transport for Ulo: handlers bound to generated method markers, an HTTP/2 server, status details, health, reflection and clientsnone1.88tokio-boundulo, ulo-grpc-macros, ulo-http, ulo-listener-tokio, ulo-net, ulo-server-hyper, ulo-transport
ulo-grpc-macrosThe gRPC method attribute for Ulo, re-exported by ulo-grpcnone1.88runtime-freeulo-handler-codegen
ulo-buildBuild-script code generation for ulo-grpc: messages, clients and the method markers handlers bind to, over a vendored protocvendored-protoc; default = [vendored-protoc]1.88runtime-freenone

Servers, listeners and embedding hosts

CrateRoleFeaturesMSRVRuntime levelDepends on (Ulo crates)
ulo-server-hyperThe accept loop Ulo's hyper servers share: one task per connection, the handshake timeout and the drain, over a listener a runtime crate suppliesnone1.88runtime-neutralulo, ulo-http, ulo-net, ulo-transport
ulo-listener-tokioThe tokio listener for Ulo's hyper servers: tokio sockets, tokio-rustls, and hyper's I/O traits over themnone1.88tokio-boundulo-http, ulo-net, ulo-server-hyper
ulo-listener-smolThe smol listener for Ulo's hyper servers: async-net sockets, futures-rustls, and hyper's I/O traits over themnone1.88runtime-neutralulo-http, ulo-net, ulo-server-hyper
ulo-http-hyperThe hyper backend for Ulo's HTTP transport, the reference servertokio; default = [tokio]1.88runtime-neutral+http2, tokio-boundulo, ulo-http, ulo-listener-tokio, ulo-net, ulo-server-hyper, ulo-transport
ulo-ws-hyperThe standalone WebSocket server for Ulo: gateways declared port = own, on hyper and the listener of the app's runtimetokio, conformance-probe; default = [tokio]1.88runtime-neutral, tokio-boundulo, ulo-http, ulo-listener-tokio, ulo-net, ulo-server-hyper, ulo-transport, ulo-ws
ulo-http-axumRuns an Ulo application inside an axum server, nested under a path or as the fallbacknone1.88tokio-boundulo, ulo-http
ulo-http-salvoRuns an Ulo application inside a salvo server, nested under a path or as the catch-allnone1.92tokio-boundulo, ulo-http
ulo-http-poemRuns an Ulo application inside a poem server, nested under a path or as the fallbacknone1.88tokio-boundulo, ulo-http
ulo-http-actixRuns an Ulo application inside an actix-web server, as a scope or the default serviceconformance-http21.88tokio-boundulo, ulo-http
ulo-http-rocketRuns an Ulo application inside a rocket server, mounted as catch-all routesnone1.88tokio-boundulo, ulo-http

RPC links

CrateRoleFeaturesMSRVRuntime levelDepends on (Ulo crates)
ulo-rpc-tcpThe TCP link for Ulo RPC: length-prefixed frames multiplexed by id over one connectionnone1.88tokio-boundulo, ulo-net, ulo-rpc, ulo-rpc-tcp-core, ulo-runtime-tokio
ulo-rpc-tcp-smolThe TCP link for Ulo RPC on smol's sockets: ulo-rpc-tcp's wire over async-net, with futures-rustls for TLSnone1.88runtime-freeulo, ulo-net, ulo-rpc, ulo-rpc-tcp-core
ulo-rpc-tcp-coreFor link authors, not applications: the runtime-free half of Ulo's TCP RPC links, shared by ulo-rpc-tcp and ulo-rpc-tcp-smolnone1.88runtime-freeulo, ulo-net, ulo-rpc, ulo-transport
ulo-rpc-udpThe UDP link for Ulo RPC: one frame per datagram, unary calls and eventsnone1.88tokio-boundulo, ulo-net, ulo-rpc, ulo-runtime-tokio, ulo-transport
ulo-rpc-natsThe NATS link for Ulo RPC: queue-group subscriptions, inbox replies, no-respondersintegration, conformance-probe1.88tokio-boundulo, ulo-rpc, ulo-runtime-tokio, ulo-transport
ulo-rpc-redisThe Redis link for Ulo RPC: Pub/Sub per pattern carrying the whole frametls, integration, conformance-probe1.88tokio-boundulo, ulo-rpc, ulo-runtime-tokio, ulo-transport
ulo-rpc-rabbitmqThe RabbitMQ (AMQP 0-9-1) link for Ulo RPC: queues, reply_to and correlation_id, confirmsintegration, conformance-probe1.88tokio-boundulo, ulo-rpc, ulo-runtime-tokio, ulo-transport
ulo-rpc-mqttThe MQTT v5 link for Ulo RPC: shared subscriptions, Response Topic and Correlation Dataintegration, conformance-probe1.88tokio-boundulo, ulo-rpc, ulo-runtime-tokio, ulo-transport
ulo-rpc-kafkaThe Kafka link for Ulo RPC: consumer groups, a reply topic and correlation headerstls, integration, conformance-probe1.88tokio-boundulo, ulo-rpc, ulo-runtime-tokio, ulo-transport

Integrations

CrateRoleFeaturesMSRVRuntime levelDepends on (Ulo crates)
ulo-configLayered configuration for Ulo: TOML, JSON, YAML, .env and the environment read into one tree whose every value knows its origin, and typed sections that report every problem at onceyaml1.88runtime-freeulo
ulo-healthHealth for Ulo: checks with bounds, liveness, readiness and startup probes, and the module that turns readiness false before the first refusal at shutdownnone1.88runtime-freeulo
ulo-health-httpThe Kubernetes probe routes for Ulo health: liveness, readiness and startup over HTTP, answered 200 or 503 with an application/health+json bodynone1.88runtime-freeulo, ulo-health, ulo-http
ulo-health-grpcThe grpc.health.v1 bridge for Ulo health: the overall status written from readiness at lifecycle transitions and on an interval, through tonic-healthnone1.88tokio-boundulo, ulo-grpc, ulo-health
ulo-dbThe shared database policy for Ulo: connect, retry, close, health and the migration lock written once over the core's readiness API, and the Store trait each driver crate implementsnone1.88runtime-freeulo, ulo-config, ulo-health
ulo-db-sqlxSQLx stores for Ulo: Postgres, MySQL and SQLite pools with the shared connect, health and migration-lock policytls, postgres, mysql, sqlite, integration; default = [tls]1.94tokio-boundulo, ulo-config, ulo-db
ulo-db-seaormSeaORM store for Ulo: a DatabaseConnection with the shared connect, health and migration-lock policy, its URL validated by SQLx's option parsertls, postgres, mysql, sqlite, integration; default = [tls]1.94tokio-boundulo, ulo-config, ulo-db, ulo-db-sqlx
ulo-db-dieselDiesel store for Ulo: a deadpool pool of diesel-async connections with the shared connect, health and migration-lock policypostgres, mysql, sqlite, integration; default = []1.89tokio-boundulo, ulo-config, ulo-db
ulo-db-mongodbMongoDB store for Ulo: a Client with the shared connect and health policy, its mongodb+srv lookup retried under the connect boundintegration1.88tokio-boundulo, ulo-config, ulo-db
ulo-db-redisRedis store for Ulo: a ConnectionManager with the shared connect and health policy, tokio-comp aloneintegration, tls, smol-comp1.88tokio-boundulo, ulo-config, ulo-db
ulo-graphqlTransport-neutral GraphQL for Ulo: the Engine SPI, requests and responsesnone1.88runtime-freeulo
ulo-graphql-httpGraphQL over HTTP for Ulo: the endpoint controller, its status rules and the playgroundnone1.88runtime-freeulo, ulo-graphql, ulo-graphql-ws, ulo-http, ulo-transport
ulo-graphql-wsGraphQL subscriptions for Ulo over graphql-transport-ws, a WebSocket gateway over any enginenone1.88runtime-freeulo, ulo-graphql, ulo-transport, ulo-ws
ulo-graphql-async-graphqlThe async-graphql engine for Ulo's GraphQL bindingsnone1.89runtime-freeulo, ulo-graphql
ulo-graphql-juniperThe juniper engine for Ulo's GraphQL bindingsnone1.88runtime-freeulo, ulo-graphql
ulo-otelOpenTelemetry export for Ulo: a tracing layer over the transports' spans, the TraceSource that parents them on the incoming trace, sampling and the flush at shutdownnone1.88runtime-freeulo, ulo-config
ulo-otel-otlpOTLP export over HTTP with protobuf for ulo-otel, on an HTTP client over ureq by default and reqwest's blocking client behind a featureureq, reqwest-blocking; default = [ureq]1.88runtime-free, tokio-boundulo, ulo-otel
ulo-ws-redisThe Redis broadcast adapter for Ulo's WebSocket transport, carrying broadcasts across processesintegration1.88tokio-boundulo, ulo-runtime-tokio, ulo-ws

Conformance suites

CrateRoleFeaturesMSRVRuntime levelDepends on (Ulo crates)
ulo-conformance-supportThe harness pieces the Ulo conformance suites sharetokio, smol1.88runtime-freeulo, ulo-runtime-smol, ulo-runtime-tokio
ulo-rpc-conformanceThe conformance suite every Ulo RPC link runstokio, smol1.88runtime-freeulo, ulo-conformance-support, ulo-rpc, ulo-transport
ulo-runtime-conformanceThe conformance suite every Ulo runtime runsnone1.88runtime-freeulo, ulo-transport

Tooling

CrateRoleFeaturesMSRVRuntime levelDepends on (Ulo crates)
ulo-cliThe ulo binary: new, generate and dev.dev; default = [dev]1.88tokio-boundnone

Not published (publish = false)

CrateRoleFeaturesDepends on (Ulo crates)
ulo-bench-overheadFramework overhead: one GET / route served by ulo and by bare hyper, driven over loopback by one load loopnoneulo, ulo-http, ulo-http-hyper, ulo-runtime-tokio
ulo-codegen-testsThe generated code of ulo-build and #[ulo_grpc::method], compiled and served, and the compile-fail checks the attributes emit; the UI snapshots live herenoneulo-grpc
ulo-db-conformanceThe conformance suite every Ulo database store runstokioulo, ulo-config, ulo-conformance-support, ulo-db, ulo-health
ulo-db-sqlx-smol-probeSQLx built with runtime-smol beside runtime-tokio, to measure where a PoolConnection dropped off the runtime returnsnonenone
ulo-grpc-interopThe gRPC project's interop TestService on ulo-grpc, for the CI job that runs the standard interop client against itnoneulo, ulo-build, ulo-grpc, ulo-runtime-tokio, ulo-test-certs
ulo-http-conformanceThe embedding conformance suite every Ulo HTTP host runs, the hyper backend as the referencetokio, smol, rocketulo, ulo-http, ulo-http-hyper, ulo-listener-smol, ulo-listener-tokio, ulo-runtime-smol, ulo-runtime-tokio, ulo-server-hyper, ulo-transport
ulo-macro-lintsEvery attribute and derive macro the framework exports, expanded in one crate for CI to lint as a user's cratenoneulo, ulo-grpc, ulo-http, ulo-rpc, ulo-transport, ulo-ws
ulo-reexport-facadeWrites the attributes #[handlers], #[controller] and #[injectable] remove through a crate re-exporting ulo, with no ulo in the manifestnoneulo-http, ulo-reexport-renamed
ulo-reexport-grpcDerives Classify and Validate through ulo-grpc alone, to pin the re-exports the derives' output namesnoneulo-grpc
ulo-reexport-renamedWrites the same attributes with ulo renamed in the manifest, and re-exports the renamed crate for ulo-reexport-facadenoneulo, ulo-http
ulo-reexport-rpcDerives Classify and Validate through ulo-rpc alone, to pin the re-exports the derives' output namesnoneulo-rpc
ulo-reexport-wsDerives Classify and Validate through ulo-ws alone, to pin the re-exports the derives' output namesnoneulo-ws
ulo-test-certsTest certificates generated at run time for the Ulo crates' TLS testsnonenone
ulo-ws-conformanceThe conformance suite every Ulo WebSocket server runs, ulo-ws-hyper's standalone server as the referencenoneulo, ulo-transport, ulo-ws

Notes on the tables

  • A feature named integration gates the tests that need a running broker or database. Without it a plain cargo test on the crate compiles the integration test target to nothing and reports 0 passed.
  • A feature named conformance-probe exposes counters the conformance suites read. Its items are #[doc(hidden)] and outside the crate's semver promise. It is not for applications.
  • ulo-rpc and ulo-ws also carry conformance-probe, which the links and servers forward.
  • The RPC links are tokio-based on a runtime of their own, captured where the link is built or named with with_handle(h). ulo-rpc-tcp-smol is the TCP link on smol's sockets.
  • ulo-db-sqlx-smol-probe builds SQLx with runtime-smol beside runtime-tokio to measure where a pool connection dropped off the runtime returns. It is a measurement and is not released.

API Reference

The crate map, the macros, the core types, the error catalogue and the feature and environment tables.

Macros

The core attributes of ulo-macros and the derives of ulo-transport-macros, with the arguments each takes, what it lowers to and what it refuses.

On this page

What an application depends onLayersPublished cratesCoreRuntimesTransport hubs and their macrosServers, listeners and embedding hostsRPC linksIntegrationsConformance suitesToolingNot published (publish = false)Notes on the tables