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
| Crate | Feature | Default | Effect |
|---|---|---|---|
ulo | serde | off | Implements Deserialize for Secret<T>. ulo-config turns it on. |
ulo-transport | validator | off | Exposes 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-http | tokio-io | off | Implements 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-hyper | tokio | on | Brings in ulo-listener-tokio, which names the Server alias on the tokio listener. Without it, ServerOn<L> takes any listener. |
ulo-ws-hyper | tokio | on | The same, for the standalone WebSocket server. |
ulo-build | vendored-protoc | on | Builds against a vendored protoc, so no system protoc is needed. A PROTOC environment variable wins over it. |
ulo-config | yaml | off | Reads YAML files. |
ulo-db-sqlx | postgres, mysql, sqlite | none | Selects the SQLx drivers. No driver is on by default. |
ulo-db-sqlx | tls | on | TLS through rustls with the native roots (sqlx/tls-rustls-ring-native-roots). |
ulo-db-seaorm | postgres, mysql, sqlite | none | Selects the driver in SeaORM, its migrations and ulo-db-sqlx together. |
ulo-db-seaorm | tls | on | Forwards to ulo-db-sqlx/tls. |
ulo-db-diesel | postgres, mysql, sqlite | none | Selects the diesel-async backend. |
ulo-db-redis | tls | off | TLS through rustls with the webpki roots. |
ulo-db-redis | smol-comp | off | The connection manager on smol, with tokio-rustls-comp kept for TLS. |
ulo-rpc-redis | tls | off | TLS through rustls with the webpki roots. |
ulo-rpc-kafka | tls | off | TLS through rdkafka/ssl. |
ulo-otel-otlp | ureq | on | OTLP export over ureq. |
ulo-otel-otlp | reqwest-blocking | off | OTLP export over reqwest's blocking client, with rustls-platform-verifier. |
ulo-cli | dev | on | The ulo dev command (watch, rebuild, restart, socket holding). Disable it for a scaffolding-only install. |
Test and conformance flags, which an application leaves off:
| Crate | Feature | Effect |
|---|---|---|
ulo-ws, ulo-rpc, ulo-ws-hyper, ulo-rpc-nats, ulo-rpc-redis, ulo-rpc-rabbitmq, ulo-rpc-mqtt, ulo-rpc-kafka | conformance-probe | Exposes 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-conformance | tokio, smol | The runtime half of a suite run on tokio (OnTokio) or on smol (OnSmol). The suite names no runtime until one is chosen. |
ulo-http-actix | conformance-http2 | Turns on actix-web/http2 for the conformance suite. |
ulo-rpc-* brokers, ulo-ws-redis, ulo-db-* | integration | Compiles 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.
| Variable | Read by | Meaning |
|---|---|---|
LISTEN_PID, LISTEN_FDS, LISTEN_FDNAMES | ulo-net | The 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_DEV | ulo-net | Set 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. |
PROTOC | ulo-build | Path to a protoc executable. Wins over the vendored one. |
OUT_DIR | ulo-build | Where the generated gRPC code is written, unless Builder::out_dir says otherwise. Cargo sets it for a build script. |
OTEL_SERVICE_NAME | OtelOptions::from_env | The service.name resource attribute. Unset, the resource names unknown_service with the executable's name. |
OTEL_EXPORTER_OTLP_ENDPOINT | OtelOptions::from_env | The OTLP receiver's base URL. The exporter appends the signal's path. |
OTEL_EXPORTER_OTLP_HEADERS | OtelOptions::from_env | Request headers as key=value,key=value. Held as a Secret, since they carry credentials. |
OTEL_TRACES_SAMPLER | OtelOptions::from_env | Sampling 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_ARG | OtelOptions::from_env | The 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.