portaldi-core 0.6.5

Core functionalities for portaldi.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
//! Global variables.

use crate::container::DIContainer;
#[cfg(any(not(target_arch = "wasm32"), feature = "multi-thread"))]
use std::sync::LazyLock;

/// Global container instance.
#[cfg(any(not(target_arch = "wasm32"), feature = "multi-thread"))]
pub(crate) static INSTANCE: LazyLock<DIContainer> = LazyLock::new(DIContainer::new);
#[cfg(all(target_arch = "wasm32", not(feature = "multi-thread")))]
thread_local! {
    pub(crate) static INSTANCE: std::rc::Rc<DIContainer> = std::rc::Rc::new(DIContainer::new());
}