nautilus_core/lib.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//! [NautilusTrader](http://nautilustrader.io) is an open-source, high-performance, production-grade
17//! algorithmic trading platform, providing quantitative traders with the ability to backtest
18//! portfolios of automated trading strategies on historical data with an event-driven engine,
19//! and also deploy those same strategies live, with no code changes.
20//!
21//! # Feature flags
22//!
23//! This crate provides feature flags to control source code inclusion during compilation,
24//! depending on the intended use case, i.e. whether to provide Python bindings
25//! for the main `nautilus_trader` Python package, or as part of a Rust only build.
26//!
27//! - `ffi`: Enables the C foreign function interface (FFI) from `cbindgen`.
28//! - `python`: Enables Python bindings from `pyo3`.
29
30#![warn(rustc::all)]
31#![deny(nonstandard_style)]
32#![deny(missing_debug_implementations)]
33#![deny(rustdoc::broken_intra_doc_links)]
34#![deny(clippy::missing_errors_doc)]
35// TODO: We still rely on `IntoPy` for now, so temporarily ignore
36// these deprecations until fully migrated to `IntoPyObject`.
37#![allow(deprecated)]
38
39pub mod consts;
40pub mod correctness;
41pub mod datetime;
42pub mod message;
43pub mod nanos;
44pub mod parsing;
45pub mod paths;
46pub mod serialization;
47pub mod time;
48pub mod uuid;
49
50#[cfg(feature = "ffi")]
51pub mod ffi;
52
53#[cfg(feature = "python")]
54pub mod python;
55
56#[cfg(not(any(target_os = "linux", target_os = "macos", target_os = "windows")))]
57compile_error!("Unsupported platform: Nautilus supports only Linux, macOS, and Windows");
58
59// Re-exports
60pub use crate::{nanos::UnixNanos, time::AtomicTime, uuid::UUID4};