Skip to main content

ferroui_splat/
lib.rs

1//! ferroui-splat
2//!
3//! A port of Splat (<https://github.com/reactiveui/splat>) to Rust: the service locator that
4//! ReactiveUI and applications find their services through, the dependency resolvers behind it,
5//! logging, the detection of a unit test runner, feature usage tracking, and the application
6//! builder with its modules. It depends on nothing of the user interface of FerroUI.
7//!
8//! The modules follow the projects of Splat:
9//!
10//! - [`service_location`]: Splat.Core's service location: the resolver interfaces
11//!   ([`IReadonlyDependencyResolver`], [`IMutableDependencyResolver`], [`IDependencyResolver`]),
12//!   the resolvers ([`ModernDependencyResolver`], [`GlobalGenericFirstDependencyResolver`],
13//!   [`InstanceGenericFirstDependencyResolver`]), [`AppLocator`] and Splat's [`Locator`].
14//! - [`builder`]: Splat.Core's `IAppBuilder`, `IAppInstance` and `IModule`, and Splat.Builder
15//!   ([`AppBuilder`]).
16//! - [`logging`]: Splat.Logging.
17//! - [`mode_detection`]: Splat's mode detection ([`ModeDetector`]).
18//! - [`application_performance_monitoring`]: Splat's feature usage tracking.
19//!
20//! Services are keyed by the type of the service, which may be a trait object
21//! (`dyn IViewLocator`), and are handed out as `Rc<S>`. Everything is single-threaded and
22//! reference counted, as the object model of FerroUI is: the locator, the resolvers and the
23//! global state of Splat are per thread (`docs/porting/reactive.md`, section 5.1).
24
25pub mod application_performance_monitoring;
26pub mod builder;
27mod disposables;
28pub mod logging;
29pub mod mode_detection;
30pub mod service_location;
31
32pub use application_performance_monitoring::{
33    DefaultFeatureUsageTrackingManager, DefaultFeatureUsageTrackingSession,
34    EnableFeatureUsageTrackingExt, FeatureUsageTrackingSessionExt, FuncFeatureUsageTrackingManager,
35    Guid, IEnableFeatureUsageTracking, IFeatureUsageTrackingManager, IFeatureUsageTrackingSession,
36    IFeatureUsageTrackingSessionOf, IViewTracking,
37};
38pub use builder::{AppBuilder, IAppBuilder, IAppInstance, IModule, ModuleExt, SplatBuilderExt};
39pub use logging::{
40    ActionLogger, ConsoleLogger, DebugLogger, DefaultLogManager, FullLoggerExt, FuncLogManager,
41    IAllocationFreeErrorLogger, IAllocationFreeLogger, IEnableLogger, IFullLogger, ILogManager,
42    ILogger, IStaticFullLogger, LogHost, LogLevel, LogManagerExt, LoggingException,
43    MemoizingMRUCache, NullLogger, SplatLogManagerModule, SplatLoggerModule, StaticFullLogger,
44    StaticFullLoggerExt, WrappingFullLogger, WrappingLogLevelLogger, WrappingPrefixLogger,
45};
46pub use mode_detection::{DefaultModeDetector, IModeDetector, Mode, ModeDetector};
47pub use service_location::{
48    AppLocator, DependencyResolverMixins, ErasedService, GlobalGenericFirstDependencyResolver,
49    IDependencyResolver, IMutableDependencyResolver, IReadonlyDependencyResolver,
50    InstanceGenericFirstDependencyResolver, LazyDisposal, Locator, ModernDependencyResolver,
51    MutableDependencyResolverExt, ReadonlyDependencyResolverExt, RegistrationCallback,
52    ResolverMixins, ServiceFactory, ServiceLocationInitializationExt, ServiceType,
53};
54
55#[cfg(test)]
56mod tests;