nautilus_common/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//! Common componentry for [NautilusTrader](http://nautilustrader.io).
17//!
18//! The *common* crate provides shared components and utilities that form the system foundation for
19//! NautilusTrader applications. This includes the actor system, message bus, caching layer, and other
20//! essential services.
21//!
22//! # Platform
23//!
24//! [NautilusTrader](http://nautilustrader.io) is an open-source, high-performance, production-grade
25//! algorithmic trading platform, providing quantitative traders with the ability to backtest
26//! portfolios of automated trading strategies on historical data with an event-driven engine,
27//! and also deploy those same strategies live, with no code changes.
28//!
29//! NautilusTrader's design, architecture, and implementation philosophy prioritizes software correctness and safety at the
30//! highest level, with the aim of supporting mission-critical, trading system backtesting and live deployment workloads.
31//!
32//! # Feature flags
33//!
34//! This crate provides feature flags to control source code inclusion during compilation,
35//! depending on the intended use case, i.e. whether to provide Python bindings
36//! for the [nautilus_trader](https://pypi.org/project/nautilus_trader) Python package,
37//! or as part of a Rust only build.
38//!
39//! - `ffi`: Enables the C foreign function interface (FFI) from [cbindgen](https://github.com/mozilla/cbindgen).
40//! - `python`: Enables Python bindings from [PyO3](https://pyo3.rs).
41//! - `stubs`: Enables type stubs for use in testing scenarios.
42//! - `defi`: Enables DeFi (Decentralized Finance) support.
43
44#![warn(rustc::all)]
45#![deny(unsafe_code)]
46#![deny(nonstandard_style)]
47#![deny(missing_debug_implementations)]
48#![deny(clippy::missing_errors_doc)]
49#![deny(clippy::missing_panics_doc)]
50#![deny(rustdoc::broken_intra_doc_links)]
51
52pub mod actor;
53pub mod cache;
54pub mod clock;
55pub mod component;
56pub mod custom;
57pub mod enums;
58pub mod factories;
59pub mod generators;
60pub mod greeks;
61pub mod logging;
62pub mod messages;
63pub mod msgbus;
64pub mod runner;
65pub mod runtime;
66pub mod signal;
67pub mod testing;
68pub mod throttler;
69pub mod timer;
70pub mod xrate;
71
72#[cfg(feature = "ffi")]
73pub mod ffi;
74
75#[cfg(feature = "python")]
76pub mod python;