Expand description
The service container. Two layers:
- Typed fields on
Container(pool, mailer, cache, queue) — primary mechanism. - Typemap for user-registered bindings.
Also exposes a task-local context for facade-style access (cache::get(...)).
Structs§
- Connection
Manager - Resolves named connections — the centerpiece of Cast’s multi-database support.
- Container
- Container
Builder - Container
Inner
Traits§
- From
Container - Trait for types that can be resolved from a
Containerreference.
Functions§
- current
- Access the current request’s container from anywhere on the request task.
Panics if called outside a
with_containerscope. - try_
current - with_
container - Run a future with a container installed in task-local context. Used by the per-request middleware so facade-style functions can find the container.
Type Aliases§
- Pool
- Backward-compat alias: the default Container pool is still
sqlx::PgPool. For multi-driver access, usec.driver_pool()(returnscast_core::Poolenum).