use crate::error::Error;
use crate::graph::DependencyHint;
use crate::injector::Injector;
use crate::instance::Instance;
use crate::runtime::Shared;
use crate::scope::Scope;
#[cfg(feature = "async-factory")]
use std::future::Future;
#[cfg(feature = "async-factory")]
use std::pin::Pin;
use std::time::Duration;
#[cfg(all(feature = "thread-safe", feature = "resource-limit-async"))]
use tokio::sync::{OwnedSemaphorePermit, Semaphore};
#[cfg(feature = "tracing")]
use tracing::{debug, info};
#[cfg(all(feature = "async-factory", not(feature = "thread-safe")))]
type AsyncFactory<T> =
Box<dyn Fn(Injector) -> Pin<Box<dyn Future<Output = Instance<T>> + 'static>> + 'static>;
#[cfg(all(feature = "async-factory", feature = "thread-safe"))]
type AsyncFactory<T> = Box<
dyn Fn(Injector) -> Pin<Box<dyn Future<Output = Instance<T>> + Send + 'static>>
+ Send
+ Sync
+ 'static,
>;
#[cfg(all(not(feature = "thread-safe"), feature = "async-factory"))]
mod constructors_non_thread_safe_async;
#[cfg(not(feature = "thread-safe"))]
mod constructors_non_thread_safe_sync;
#[cfg(all(feature = "thread-safe", feature = "async-factory"))]
mod constructors_thread_safe_async;
#[cfg(feature = "thread-safe")]
mod constructors_thread_safe_sync;
mod limiter_acquire;
mod limiter_release;
mod limiter_types;
mod provider_common;
#[cfg(feature = "debug")]
mod provider_debug;
mod provider_type;
use limiter_types::{CreationPermit, Limiter};
pub use limiter_types::{Limits, Policy};
pub use provider_type::Provider;
#[cfg(test)]
mod tests;