Skip to main content

Crate mads_core

Crate mads_core 

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

ApplicationContext
Owns the immutable providers and configuration of a running application.
ApplicationGraph
An immutable ordered provider graph.
AutoConfigurationConfigEvidence
Redacted evidence that a configuration key was present in a named source.
AutoConfigurationReasonCode
A stable, machine-readable reason for an auto-configuration outcome.
AutoConfigurationReport
A redacted report describing one auto-configuration decision.
AutoConfigurationRequirement
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.
ConfigBuilder
Builds a configuration by merging ordered sources.
ConfigDocument
A redacted configuration document containing supported value shapes.
ConfigValue
A configuration value and the source that supplied it.
ConfigurationErrors
One or more typed configuration failures in declaration order.
ConfigurationIssue
A safe failure for one configuration key.
ConstructionContext
Borrows the providers and configuration available while constructing an application.
ConstructionPlan
A deterministic sequence of providers to construct.
ConstructionStep
One statically declared provider in construction order.
DependencyDescriptor
Describes a provider dependency by its stable type metadata.
DependencyEdge
A resolved dependency from one provider to a required type.
Diagnostic
A structured diagnostic with optional source context and suggestions.
DiagnosticCode
A stable identifier for a MADS.rs diagnostic.
DotenvSource
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.
GraphAnalysis
The result of graph inspection and validation.
LifecycleManager
Coordinates ordered lifecycle hooks for one application.
LifecycleResource
A native provider value accompanied by lifecycle hooks registered for it.
Mads
An explicitly constructed application and its lifecycle state.
MadsBuilder
Builds an application by explicitly providing and constructing providers.
MapSource
A fixed, named set of configuration values.
ModuleDescriptor
Describes a statically declared application module.
ModuleGraph
The deterministic module scope retained for a rooted application.
ModuleImportDescriptor
One direct module import emitted by #[module(imports = [ImportedModule])].
ModuleImportEdge
A direct, authored import between two reachable modules.
ModuleNode
A reachable module in a rooted application graph.
ProviderDescriptor
Describes a statically declared provider and its constructor.
ProviderNode
Immutable metadata for one provider in an application graph.
ProviderOwnership
Associates a selected provider with its owning reachable module, if any.
ProviderRegistry
Stores at most one application-scoped provider for each concrete type.
Secret
A value whose ordinary formatting is always redacted.
SourceLocation
The source position associated with a diagnostic.
TomlSource
A TOML configuration file source.

Enums§

AutoConfigurationStatus
The outcome of evaluating an auto-configuration descriptor.
LifecycleState
The lifecycle state of an application.
ProviderKind
Categorizes the role a provider plays in an application.
ProviderOrigin
Describes how a provider enters an application graph.
ProviderState
Describes how a provider value is satisfied for a specific build.
ProviderVisibility
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§

ConfigSource
A source of string configuration values.
Configuration
A typed view parsed explicitly from an already loaded configuration.
LifecycleHook
Starts and stops an application resource.
Module
Marker implemented by #[module] declarations.

Type Aliases§

ConfigurationResult
The result of parsing or validating a typed configuration.
ErasedProvider
A type-erased application-scoped provider allocation.
LifecycleFuture
The asynchronous result returned by a lifecycle hook.
ProviderConstructor
Constructs a provider using the dependencies and configuration available at startup.
ProviderFuture
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.