nautilus_persistence/
config.rs

1// -------------------------------------------------------------------------------------------------
2//  Copyright (C) 2015-2025 Nautech Systems Pty Ltd. All rights reserved.
3//  https://nautechsystems.io
4//
5//  Licensed under the GNU Lesser General Public License Version 3.0 (the "License");
6//  You may not use this file except in compliance with the License.
7//  You may obtain a copy of the License at https://www.gnu.org/licenses/lgpl-3.0.en.html
8//
9//  Unless required by applicable law or agreed to in writing, software
10//  distributed under the License is distributed on an "AS IS" BASIS,
11//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12//  See the License for the specific language governing permissions and
13//  limitations under the License.
14// -------------------------------------------------------------------------------------------------
15
16// Under development
17#![allow(dead_code)]
18#![allow(unused_variables)]
19
20use crate::backend::feather::RotationConfig;
21
22/// Configuration for streaming live or backtest runs to the catalog in feather format.
23#[derive(Debug, Clone)]
24pub struct StreamingConfig {
25    /// The path to the data catalog.
26    catalog_path: String,
27    /// The `fsspec` filesystem protocol for the catalog.
28    fst_protocol: String,
29    /// The flush interval (milliseconds) for writing chunks.
30    flush_interval_ms: u64,
31    /// If any existing feather files should be replaced.
32    replace_existing: bool,
33    /// Rotation config
34    rotation_config: RotationConfig,
35}
36
37impl StreamingConfig {
38    /// Create a new streaming configuration.
39    #[must_use]
40    pub const fn new(
41        catalog_path: String,
42        fst_protocol: String,
43        flush_interval_ms: u64,
44        replace_existing: bool,
45        rotation_config: RotationConfig,
46    ) -> Self {
47        Self {
48            catalog_path,
49            fst_protocol,
50            flush_interval_ms,
51            replace_existing,
52            rotation_config,
53        }
54    }
55}
56
57/// Configuration for a data catalog.
58pub struct DataCatalogConfig {
59    /// The path to the data catalog.
60    path: String,
61    /// The fsspec file system protocol for the data catalog.
62    fs_protocol: String,
63}
64
65impl DataCatalogConfig {
66    /// Create a new data catalog configuration.
67    #[must_use]
68    pub const fn new(path: String, fs_protocol: String) -> Self {
69        Self { path, fs_protocol }
70    }
71}