Expand description
Framework-neutral runtime contracts for MADS.rs.
MADS core provides framework-neutral application construction, lifecycle
management, deterministic scalar TOML configuration, optional dotenv
interpolation, programmatic and environment sources, provider metadata, and
dependency graph analysis. Dotenv values only participate in interpolation:
they do not mutate process state, and real process variables take
precedence. Applications construct configuration explicitly; Mads::builder
does not load files, dotenv variables, or process environment variables.
Core also owns deterministic evaluation of official conditional defaults and
the public, retained AutoConfigurationReport records that explain their
decisions. Reports retain only stable identifiers, reason codes, and redacted
configuration evidence; they never retain resolved configuration values. The
v0.5 catalog is complete across statically discovered providers. Module-scoped
reachability is deferred to v0.6. Core re-exports the procedural macros
without introducing integration dependencies.
Structs§
- Application
Context - Owns the immutable providers and configuration of a running application.
- Application
Graph - An immutable ordered provider graph.
- Auto
Configuration Config Evidence - Redacted evidence that a configuration key was present in a named source.
- Auto
Configuration Reason Code - A stable, machine-readable reason for an auto-configuration outcome.
- Auto
Configuration Report - A redacted report describing one auto-configuration decision.
- Auto
Configuration Requirement - A provider requirement that contributed to an auto-configuration decision.
- Catalog
- Provides deterministic access to statically registered providers and modules.
- Config
- Configuration values merged in source insertion order.
- Config
Builder - Builds a configuration by merging ordered sources.
- Config
Document - A redacted configuration document containing supported value shapes.
- Config
Value - A configuration value and the source that supplied it.
- Configuration
Errors - One or more typed configuration failures in declaration order.
- Configuration
Issue - A safe failure for one configuration key.
- Construction
Context - Borrows the providers and configuration available while constructing an application.
- Construction
Plan - A deterministic sequence of providers to construct.
- Construction
Step - One statically declared provider in construction order.
- Dependency
Descriptor - Describes a provider dependency by its stable type metadata.
- Dependency
Edge - A resolved dependency from one provider to a required type.
- Diagnostic
- A structured diagnostic with optional source context and suggestions.
- Diagnostic
Code - A stable identifier for a MADS.rs diagnostic.
- Dotenv
Source - A dotenv file whose variables are available for configuration interpolation.
- EnvSource
- An environment-variable configuration source.
- Error
- A framework error containing a structured diagnostic and optional cause.
- Graph
Analysis - The result of graph inspection and validation.
- Lifecycle
Manager - Coordinates ordered lifecycle hooks for one application.
- Lifecycle
Resource - A native provider value accompanied by lifecycle hooks registered for it.
- Mads
- An explicitly constructed application and its lifecycle state.
- Mads
Builder - Builds an application by explicitly providing and constructing providers.
- MapSource
- A fixed, named set of configuration values.
- Module
Descriptor - Describes a statically declared application module.
- Module
Graph - The deterministic module scope retained for a rooted application.
- Module
Import Descriptor - One direct module import emitted by
#[module(imports = [ImportedModule])]. - Module
Import Edge - A direct, authored import between two reachable modules.
- Module
Node - A reachable module in a rooted application graph.
- Provider
Descriptor - Describes a statically declared provider and its constructor.
- Provider
Node - Immutable metadata for one provider in an application graph.
- Provider
Ownership - Associates a selected provider with its owning reachable module, if any.
- Provider
Registry - Stores at most one application-scoped provider for each concrete type.
- Secret
- A value whose ordinary formatting is always redacted.
- Source
Location - The source position associated with a diagnostic.
- Toml
Source - A TOML configuration file source.
Enums§
- Auto
Configuration Status - The outcome of evaluating an auto-configuration descriptor.
- Lifecycle
State - The lifecycle state of an application.
- Provider
Kind - Categorizes the role a provider plays in an application.
- Provider
Origin - Describes how a provider enters an application graph.
- Provider
State - Describes how a provider value is satisfied for a specific build.
- Provider
Visibility - Describes whether a provider declaration is public outside its Rust module.
Constants§
- MADS001
- Duplicate provider registration.
- MADS002
- Ambiguous provider binding.
- MADS003
- Missing provider registration.
- MADS004
- Provider registry type mismatch.
- MADS005
- Dependency cycle.
- MADS006
- Provider construction failure.
- MADS007
- Auto-configuration failure.
- MADS008
- Invalid rooted module graph.
- MADS009
- Inaccessible provider across a module boundary.
- MADS010
- Invalid lifecycle state transition.
- MADS011
- Lifecycle hook failure.
- MADS020
- Configuration source failure.
- MADS030
- Conflicting integration route declarations.
Traits§
- Config
Source - A source of string configuration values.
- Configuration
- A typed view parsed explicitly from an already loaded configuration.
- Lifecycle
Hook - Starts and stops an application resource.
- Module
- Marker implemented by
#[module]declarations.
Type Aliases§
- Configuration
Result - The result of parsing or validating a typed configuration.
- Erased
Provider - A type-erased application-scoped provider allocation.
- Lifecycle
Future - The asynchronous result returned by a lifecycle hook.
- Provider
Constructor - Constructs a provider using the dependencies and configuration available at startup.
- Provider
Future - The asynchronous result of constructing an erased provider.
- Result
- The result type used by MADS.rs framework APIs.
Attribute Macros§
- main
- Replaces an asynchronous application entry point with a Tokio-backed main function.
- module
- Declares a non-generic unit struct as an application module.
- provider
- Declares a free function as a general-purpose provider.
- repository
- Declares a named-field or unit struct as a persistence repository.
- service
- Declares a named-field or unit struct as an application service.
- test
- Registers a zero-argument async Cargo test with a function-local fixture builder.
Derive Macros§
- Configuration
- Derives an explicit typed view over an already loaded configuration.