Skip to main content

file_engine/
engine.rs

1/// Base struct (always present). Holds only shared config — no
2/// feature-specific state (e.g. no `notify` watcher handles). Those live
3/// inside each feature's own builder/handle types.
4pub struct FileEngine {
5    default_options: EngineOptions,
6}
7
8#[derive(Debug, Clone)]
9pub struct EngineOptions {
10    pub buffer_size: usize,
11    pub follow_symlinks: bool,
12}
13
14impl Default for EngineOptions {
15    fn default() -> Self {
16        Self {
17            buffer_size: 1024 * 1024,
18            follow_symlinks: false,
19        }
20    }
21}
22
23impl FileEngine {
24    pub fn new() -> Self {
25        Self {
26            default_options: EngineOptions::default(),
27        }
28    }
29
30    pub fn with_options(options: EngineOptions) -> Self {
31        Self {
32            default_options: options,
33        }
34    }
35
36    pub fn options(&self) -> &EngineOptions {
37        &self.default_options
38    }
39}
40
41impl Default for FileEngine {
42    fn default() -> Self {
43        Self::new()
44    }
45}
46
47// Feature-gated `impl FileEngine` blocks (§8.2) live in their own feature
48// modules (operations.rs, analyze.rs, watch.rs, compress.rs, sync.rs), not
49// here — this module only owns the base struct.