Skip to main content

Crate servlet

Crate servlet 

Source
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.
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§

ConfigError
A configuration constraint that must be resolved before startup.
Error
Startup, configuration, process, and lifecycle failures.
FailureKind
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 main returning servlet::Result<()>.