1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//! # Ferrunix
//!
//! A simple, idiomatic, and lightweight [dependency injection] framework for Rust.
//!
//! **For a comprehensive introduction check out the [user guide].**
//!
//! ## Documentation
//!
//! Due to how the various features affect the public API of the library, the
//! documentation is provided seperately for each major feature.
//!
//! _Documentation on [docs.rs] is compiled with the `multithread` feature turned on_
//!
//! | Feature Flags | Link to Documentation |
//! | ------------------- | --------------------- |
//! | `none` | [link to docs](https://leandros.github.io/ferrunix/docs-default/ferrunix/) |
//! | `multithread` | [link to docs](https://leandros.github.io/ferrunix/docs-multithread/ferrunix/) |
//! | `tokio` | [link to docs](https://leandros.github.io/ferrunix/docs-multithread/ferrunix/) |
//!
//! ## Getting Started
//!
//! The easiest way to get started is with the multi-threaded registry, and the derive macro,
//! you can enable this as follows:
//!
//! ```toml
//! [dependencies]
//! ferrunix = { version = "0.5", features = ["multithread"] }
//! ```
//!
//! ## Cargo Feature Flags
//!
//! Ferrunix has the following [features] to enable further functionality.
//! Features enabled by default are marked with `*`.
//!
//! - `multithread`: Enables support for accessing the registry from multiple
//! threads. This adds a bound that all registered types must be `Send`.
//! - `derive` (`*`): Enables support for the `#[derive(Inject)]` macro.
//! - `tokio`: Enables support for `async` constructors. Bumps the MSRV up to
//! `1.75.0` because some of the internal traits require [RPITIT].
//! - `tracing`: Enables support for [tracing] and annotates all public functions with
//! [`tracing::instrument`].
//!
//! [dependency injection]: https://en.wikipedia.org/wiki/Dependency_injection
//! [docs.rs]: https://docs.rs/ferrunix
//! [user guide]: https://leandros.github.io/ferrunix/user-guide/first-steps.html
//! [RPITIT]: https://blog.rust-lang.org/2023/12/21/async-fn-rpit-in-traits.html#whats-stabilizing
//! [features]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-features-section
//! [tracing]: https://docs.rs/tracing/latest/tracing/index.html
//! [`tracing::instrument`]: https://docs.rs/tracing/latest/tracing/attr.instrument.html
pub use dependencies;
pub use dependency_builder;
pub use registry;
pub use types;
pub use error;
pub use Singleton;
pub use Transient;
pub use Registry;
pub use Inject;
/// Register a [`RegistrationFunc`]. Usually invoked by the derive macro.
///
pub use autoregister;
pub use RegistrationFunc;
pub use Ref;