fundle 0.3.0

Compile-time safe dependency injection for Rust.
Documentation
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

//! Utility macros for exporting data from a bundle.
//!
//! Currently used, but not useful, due to Rust compiler bug [#51445](https://github.com/rust-lang/rust/issues/51445).
//! Once that is fixed, the `#[forward]` macro should work without parameters.

/// General info for exported data.
///
/// This is automatically implemented for each bundle by the `bundle` macro.
pub trait Exports {
    /// Number of exports for this bundle.
    const NUM_EXPORTS: usize;
}

/// Marker for the single N-th export.
///
/// This is implemented multiple times for each bundle,
/// once per contained field.
pub trait Export<const N: usize> {
    /// Type of the export.
    type T;
    /// Get the N-th export.
    fn get(&self) -> &Self::T;
}