noema 0.4.0

Noema IOC and DI framework for Rust
Documentation
//! Typed configuration: async [`ConfigSource`], `#[derive(Configurable)]`, [`config!`].
//!
//! See [`docs/config.md`](../docs/config.md).

#[macro_use]
mod macros;

mod error;
mod registry;
mod source;

pub use error::ConfigError;
pub use noema_macros::Configurable;
pub use registry::{HydrateFn, load, register};
pub use source::{ConfigSource, EnvSource, MapSource};

/// Build `Self` from a [`ConfigSource`] (generated by `#[derive(Configurable)]`).
#[async_trait::async_trait]
pub trait Configurable: Sized + Send + Sync + 'static {
    async fn from_source(source: &dyn ConfigSource) -> Result<Self, ConfigError>;
}