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

Features and environment

Every cargo feature flag the published crates declare and every environment variable the framework reads.

Features are read from each crate's Cargo.toml. A crate not listed declares none. Features are additive: turning one on adds an optional dependency or an implementation and changes nothing that compiled without it.

Cargo features

CrateFeatureDefaultEffect
uloserdeoffImplements Deserialize for Secret<T>. ulo-config turns it on.
ulo-transportvalidatoroffExposes validator_bridge::violations(&ValidationErrors) -> Vec<FieldViolation>, which a type that already derives validator::Validate calls from a three-line Validate impl. No blanket impl is written, because a blanket impl behind a feature changes coherence for every downstream crate when it turns on.
ulo-httptokio-iooffImplements tokio's I/O traits for the upgraded connection. The crate is otherwise runtime-free and carries its I/O on futures-io.
ulo-http-hypertokioonBrings in ulo-listener-tokio, which names the Server alias on the tokio listener. Without it, ServerOn<L> takes any listener.
ulo-ws-hypertokioonThe same, for the standalone WebSocket server.
ulo-buildvendored-protoconBuilds against a vendored protoc, so no system protoc is needed. A PROTOC environment variable wins over it.
ulo-configyamloffReads YAML files.
ulo-db-sqlxpostgres, mysql, sqlitenoneSelects the SQLx drivers. No driver is on by default.
ulo-db-sqlxtlsonTLS through rustls with the native roots (sqlx/tls-rustls-ring-native-roots).
ulo-db-seaormpostgres, mysql, sqlitenoneSelects the driver in SeaORM, its migrations and ulo-db-sqlx together.
ulo-db-seaormtlsonForwards to ulo-db-sqlx/tls.
ulo-db-dieselpostgres, mysql, sqlitenoneSelects the diesel-async backend.
ulo-db-redistlsoffTLS through rustls with the webpki roots.
ulo-db-redissmol-compoffThe connection manager on smol, with tokio-rustls-comp kept for TLS.
ulo-rpc-redistlsoffTLS through rustls with the webpki roots.
ulo-rpc-kafkatlsoffTLS through rdkafka/ssl.
ulo-otel-otlpureqonOTLP export over ureq.
ulo-otel-otlpreqwest-blockingoffOTLP export over reqwest's blocking client, with rustls-platform-verifier.
ulo-clidevonThe ulo dev command (watch, rebuild, restart, socket holding). Disable it for a scaffolding-only install.

Test and conformance flags, which an application leaves off:

CrateFeatureEffect
ulo-ws, ulo-rpc, ulo-ws-hyper, ulo-rpc-nats, ulo-rpc-redis, ulo-rpc-rabbitmq, ulo-rpc-mqtt, ulo-rpc-kafkaconformance-probeExposes the counters the conformance suites read. Its items are #[doc(hidden)] and outside the crates' semver promise. Enabled by the suites.
ulo-conformance-support, ulo-rpc-conformancetokio, smolThe runtime half of a suite run on tokio (OnTokio) or on smol (OnSmol). The suite names no runtime until one is chosen.
ulo-http-actixconformance-http2Turns on actix-web/http2 for the conformance suite.
ulo-rpc-* brokers, ulo-ws-redis, ulo-db-*integrationCompiles the tests that need a running broker or database. A plain cargo test on those crates reports 0 passed, because the test target compiles to nothing.

Ulo installs no default logger and has no logger feature. An application installs its own tracing subscriber, or ulo-otel's layer.

Environment variables

The framework reads few variables. A variable the application chooses, such as a database URL, is read by the application or through ulo-config.

VariableRead byMeaning
LISTEN_PID, LISTEN_FDS, LISTEN_FDNAMESulo-netThe socket-activation protocol: inherited sockets start at file descriptor 3. A socket is addressed by name from LISTEN_FDNAMES or by position among LISTEN_FDS. Read when an endpoint is an inherited socket, or when ULO_DEV is 1. Unix only.
ULO_DEVulo-netSet to 1 by ulo dev. An address written as Server::new("0.0.0.0:8080") then adopts the socket that ulo dev --listen 0.0.0.0:8080 holds across restarts, and binds the address itself in production. With no matching inherited socket, the address binds as written.
PROTOCulo-buildPath to a protoc executable. Wins over the vendored one.
OUT_DIRulo-buildWhere the generated gRPC code is written, unless Builder::out_dir says otherwise. Cargo sets it for a build script.
OTEL_SERVICE_NAMEOtelOptions::from_envThe service.name resource attribute. Unset, the resource names unknown_service with the executable's name.
OTEL_EXPORTER_OTLP_ENDPOINTOtelOptions::from_envThe OTLP receiver's base URL. The exporter appends the signal's path.
OTEL_EXPORTER_OTLP_HEADERSOtelOptions::from_envRequest headers as key=value,key=value. Held as a Secret, since they carry credentials.
OTEL_TRACES_SAMPLEROtelOptions::from_envSampling is always parent-based, so parentbased_always_on, parentbased_always_off or parentbased_traceidratio, matched without regard to case. Any other sampler is a problem and not a silent change of meaning.
OTEL_TRACES_SAMPLER_ARGOtelOptions::from_envThe ratio, between 0 and 1, read only under parentbased_traceidratio. It is 1.0 when unset.

A variable set to the empty string is read as unset by OtelOptions::from_env. The per-signal names, OTEL_EXPORTER_OTLP_TRACES_ENDPOINT among them, are not read.

OtelOptions::from_env(&Env) reads through an Env the application passes, so a test fills one from a map with Env::from_map. Env::process() reads the process environment; Env::prefix(..) and Env::separator(..) map APP_DATABASE__URL to the path database.url. The names an application configures this way are its own and are not listed here. See Configuration.

The core installs no signal handler and reads no variable. ulo_runtime_tokio::shutdown_signal() is a future that resolves to a Signal on SIGTERM or Ctrl-C, handed to App::serve. The PORT variable some example binaries read is the example's own.

The conformance crates read test-only variables, and ulo-conformance-support and ulo-rpc-conformance are the published ones. ULO_CONFORMANCE_PARALLEL is a positive integer bounding how many scenarios hold an environment at once, and the smaller of it and the suite's own bound applies. ULO_CONFORMANCE_FAILURES is a directory where a failed startup writes its message for CI to upload. Unset, the directory is conformance-failures in the target directory the running test binary was built into. ULO_CONF_REPORT_STALL is a switch for a database stall report.

Errors and diagnostics

Every error type the core returns, the wiring failures with their report text, and the compile-time diagnostics, by the phase that raises them.

On this page

Cargo featuresEnvironment variables