noema 0.1.4

Noema IOC and DI framework for Rust
Documentation
//! Noema
//! Dependency Injection and Mediator Pattern Library for Rust
//! - static registries
//! - compile-time resolution
//! - Arc + LazyLock for thread-safe singletons
//! - macros for easy registration
//! - extensible via traits
//!
//! # Features
//! - Event Dispatching
//! - Input/Output Mediation
//! - Configuration Management
//! - Keyed Service Registries
//! - Item Collections (For Extensible Enumerations or Flags)
//! - Dependency Injection

pub mod configuration;
pub mod dispatcher;
pub mod inject;
pub mod items;
pub mod keyed_service;
pub mod module;
pub mod resolver;
pub mod sender;
pub mod value_object;
use std::error::Error;

pub use noema_macros::*;

/// A type alias for a boxed dynamic error that is Send and Sync, suitable for use in async contexts and across threads.
pub type DynBoxError = Box<dyn Error + Send + Sync>;

/// A helper macro to create a type alias for a dynamic trait object wrapped in an Arc.
/// Requires have been imported `std::sync::Arc` in the scope where this macro is used.
/// Arc<dyn Trait + Send + Sync>
#[macro_export]
macro_rules! Dyn {
    ($trait:path) => {
        Arc<dyn $trait + Send + Sync>
    };
}

pub use dispatcher::dispatch;
pub use inject::Injectable;
pub use items::collection;
pub use keyed_service::services;
pub use resolver::resolve;
pub use sender::send;