nautilus_data/engine/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
16use nautilus_model::{enums::BarIntervalType, identifiers::ClientId};
17
18/// Configuration for `DataEngine` instances.
19#[derive(Clone, Debug)]
20pub struct DataEngineConfig {
21 pub time_bars_build_with_no_updates: bool,
22 pub time_bars_timestamp_on_close: bool,
23 pub time_bars_interval_type: BarIntervalType,
24 pub validate_data_sequence: bool,
25 pub buffer_deltas: bool,
26 pub external_clients: Option<Vec<ClientId>>,
27 pub debug: bool,
28}
29
30impl Default for DataEngineConfig {
31 /// Creates a new default [`DataEngineConfig`] instance.
32 fn default() -> Self {
33 Self {
34 time_bars_build_with_no_updates: true,
35 time_bars_timestamp_on_close: true,
36 time_bars_interval_type: BarIntervalType::LeftOpen,
37 validate_data_sequence: false,
38 buffer_deltas: false,
39 external_clients: None,
40 debug: false,
41 }
42 }
43}