subx_core/core/mod.rs
1//! Core processing engine for SubX.
2//!
3//! This module contains core subsystems for file operations, subtitle format
4//! handling, language detection, matching algorithms, parallel processing,
5//! synchronization, and dependency injection management.
6//!
7//! Each subsystem is organized into its own submodule:
8//! - `file_manager` for safe file operations with rollback support
9//! - `formats` for parsing and converting subtitle formats
10//! - `language` for language detection and handling
11//! - `input` for input path collection, directory scanning and archive extraction
12//! - `matcher` for AI-powered subtitle matching algorithms
13//! - `parallel` for task scheduling and parallel execution
14//! - `report` for the transport-agnostic reporting seam core reports through
15//! - `sync` for audio-text synchronization engines
16//! - `factory` for component creation with dependency injection
17//! - `services` for service container and dependency management
18//!
19#![allow(dead_code)]
20
21pub mod archive;
22pub mod factory;
23pub mod file_manager;
24pub mod formats;
25pub mod fs_util;
26pub mod input;
27pub mod language;
28pub mod lock;
29pub mod matcher;
30pub mod parallel;
31pub mod report;
32pub mod sync;
33pub mod translation;
34pub mod uuidv7;
35
36// Re-export commonly used types
37pub use factory::ComponentFactory;
38
39/// Compile-time thread-safety contract for the orchestration surface.
40///
41/// The list below is the contract, not a record of one change's edits:
42/// every type named here is guaranteed `Send + Sync + 'static`, and a new
43/// public engine, factory or manager type must be added by the change that
44/// adds it (see the `async-runtime-safety` requirement *Library Engine
45/// Types Are `Send` and `Sync`*).
46///
47/// A compile failure on one of these lines means a field of that type lost
48/// its auto traits (an `Rc`, a `RefCell`, or a trait object whose trait
49/// names no `Send`/`Sync` supertraits) — it does not mean the assertion is
50/// wrong. Fix the field, or move the type out of the orchestration surface
51/// deliberately.
52#[cfg(test)]
53mod thread_safety {
54 const fn assert_send_sync<T: Send + Sync + 'static>() {}
55
56 const _: () = assert_send_sync::<crate::core::formats::manager::FormatManager>();
57 const _: () = assert_send_sync::<crate::core::formats::converter::FormatConverter>();
58 const _: () = assert_send_sync::<crate::core::translation::TranslationEngine>();
59 const _: () = assert_send_sync::<crate::core::matcher::MatchEngine>();
60 const _: () = assert_send_sync::<crate::core::sync::SyncEngine>();
61 const _: () = assert_send_sync::<crate::core::ComponentFactory>();
62 const _: () = assert_send_sync::<crate::core::file_manager::FileManager>();
63 const _: () = assert_send_sync::<Box<dyn crate::core::formats::SubtitleFormat>>();
64}