Expand description
A small application runtime with supervised workers and coordinated shutdown.
Build routes with App, use App::start inside an existing Tokio runtime,
or combine main and App::run for process-owned signal handling.
Re-exports§
pub use serde;
Modules§
- ecosystem
- Upstream types retain their identity and are part of Servlet’s public API.
- fs
- Asynchronous file utilities.
- health
- Bounded background readiness checks and cached administrative probes.
- io
- Traits, helpers, and type definitions for asynchronous I/O functionality.
- metrics
- Application-owned Prometheus instruments with bounded, frozen definitions.
- net
- TCP/UDP/Unix bindings for
tokio. - process
- Explicit process bootstrap and signal ownership.
- settings
- Explicit application settings, captured once into an immutable startup snapshot.
- setup
- Deferred initialization and explicitly registered resource cleanup.
- span
- Spans represent periods of time in which a program was executing in a particular context.
- sync
- Synchronization primitives for use in asynchronous contexts.
- task
- Required workers and read-only shutdown notification.
- telemetry
- Application-owned counters and explicit, bounded process logging.
- time
- Utilities for tracking time.
- web
- Axum-compatible routing and Servlet’s owned HTTP/1 connection driver.
Macros§
- debug
- Constructs an event at the debug level.
- debug_
span - Constructs a span at the debug level.
- error
- Constructs an event at the error level.
- error_
span - Constructs a span at the error level.
- info
- Constructs an event at the info level.
- info_
span - Constructs a span at the info level.
- span
- Constructs a new span.
- trace
- Constructs an event at the trace level.
- trace_
span - Constructs a span at the trace level.
- warn
- Constructs an event at the warn level.
- warn_
span - Constructs a span at the warn level.
Structs§
- App
- Builds an application whose routes still need state
S. - AppConfig
- Runtime settings; validation does not start infrastructure.
- AppHandle
- A cloneable request/observation handle; it does not own application lifetime.
- Components
- Named application factories for a binary that can run different components.
- Failure
- A failure observed while supervising or stopping one named component.
- Level
- Describes the level of verbosity of a span or event.
- Lifecycle
Status - Read-only lifecycle information, available even before startup completes.
- Running
- Owns an application. Dropping it requests shutdown but does not await cleanup.
- Span
- A handle representing a span, with the capability to enter the span if it exists.
Enums§
- Config
Error - A configuration constraint that must be resolved before startup.
- Error
- Startup, configuration, process, and lifecycle failures.
- Failure
Kind - Reasons a coordinated lifecycle could not finish successfully.
- Phase
- The coordinator’s current lifecycle stage.
- Role
- Select which application routes and workers run.
Traits§
- Instrument
- Attaches spans to a
std::future::Future.
Type Aliases§
- Result
- A runtime operation’s result. Application services retain their own errors.
Attribute Macros§
- instrument
- Instrument a safe Rust function using native Tracing spans through the facade.
- main
- Run an async, argument-free
mainreturningservlet::Result<()>.