From c1fe03868e67f32be2cadb515eeb37574258de52 Mon Sep 17 00:00:00 2001 From: Chris Sellers Date: Sun, 21 Apr 2024 10:00:28 +1000 Subject: [PATCH] Add additional Rust docs --- Makefile | 2 +- nautilus_core/accounting/src/account/mod.rs | 2 ++ nautilus_core/accounting/src/python/mod.rs | 2 +- nautilus_core/adapters/src/databento/mod.rs | 2 ++ nautilus_core/adapters/src/databento/python/mod.rs | 2 +- nautilus_core/backtest/src/engine.rs | 2 ++ nautilus_core/backtest/src/matching_engine.rs | 2 ++ nautilus_core/common/src/cache/mod.rs | 2 ++ nautilus_core/common/src/clock.rs | 2 ++ nautilus_core/common/src/enums.rs | 2 ++ nautilus_core/common/src/factories.rs | 2 ++ nautilus_core/common/src/generators/mod.rs | 2 ++ nautilus_core/common/src/handlers.rs | 2 ++ nautilus_core/common/src/interface/mod.rs | 2 ++ nautilus_core/common/src/logging/mod.rs | 2 ++ nautilus_core/common/src/msgbus/mod.rs | 2 ++ nautilus_core/common/src/python/mod.rs | 2 +- nautilus_core/common/src/runtime.rs | 2 ++ nautilus_core/common/src/stubs.rs | 2 ++ nautilus_core/common/src/testing.rs | 2 ++ nautilus_core/common/src/timer.rs | 2 ++ nautilus_core/core/src/python/mod.rs | 2 +- nautilus_core/core/src/uuid.rs | 4 ++-- nautilus_core/execution/src/client.rs | 2 ++ nautilus_core/execution/src/engine.rs | 2 ++ nautilus_core/execution/src/matching_core.rs | 2 ++ nautilus_core/execution/src/messages/mod.rs | 2 ++ nautilus_core/indicators/src/average/mod.rs | 2 ++ nautilus_core/indicators/src/book/mod.rs | 2 ++ nautilus_core/indicators/src/indicator.rs | 2 ++ nautilus_core/indicators/src/momentum/mod.rs | 2 ++ nautilus_core/indicators/src/python/mod.rs | 2 +- nautilus_core/indicators/src/ratio/mod.rs | 2 ++ nautilus_core/indicators/src/stubs.rs | 2 ++ nautilus_core/indicators/src/testing.rs | 2 ++ nautilus_core/indicators/src/volatility/mod.rs | 2 ++ nautilus_core/infrastructure/src/lib.rs | 1 + nautilus_core/infrastructure/src/python/mod.rs | 2 +- nautilus_core/infrastructure/src/redis/mod.rs | 2 ++ nautilus_core/infrastructure/src/sql/mod.rs | 2 ++ nautilus_core/model/src/currencies.rs | 2 ++ nautilus_core/model/src/data/mod.rs | 2 ++ nautilus_core/model/src/events/mod.rs | 2 ++ nautilus_core/model/src/identifiers/mod.rs | 2 ++ nautilus_core/model/src/instruments/mod.rs | 2 ++ nautilus_core/model/src/macros.rs | 2 ++ nautilus_core/model/src/orderbook/mod.rs | 2 ++ nautilus_core/model/src/orders/mod.rs | 2 ++ nautilus_core/model/src/polymorphism.rs | 2 ++ nautilus_core/model/src/position.rs | 2 ++ nautilus_core/model/src/python/mod.rs | 2 +- nautilus_core/model/src/stubs.rs | 2 ++ nautilus_core/model/src/types/mod.rs | 2 ++ nautilus_core/model/src/venues.rs | 2 ++ nautilus_core/network/src/http.rs | 2 ++ nautilus_core/network/src/python/mod.rs | 2 +- nautilus_core/network/src/socket.rs | 2 ++ nautilus_core/network/src/websocket.rs | 2 ++ nautilus_core/persistence/src/arrow/mod.rs | 2 ++ nautilus_core/persistence/src/backend/mod.rs | 2 ++ nautilus_core/persistence/src/python/mod.rs | 2 +- 61 files changed, 111 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 5d7ee82aec98..608156e68cb8 100644 --- a/Makefile +++ b/Makefile @@ -70,7 +70,7 @@ docs-python: install-just-deps-all .PHONY: docs-rust docs-rust: - (cd nautilus_core && RUSTDOCFLAGS="--enable-index-page -Zunstable-options" cargo +nightly doc --no-deps) + (cd nautilus_core && RUSTDOCFLAGS="--enable-index-page -Zunstable-options" cargo +nightly doc --all-features --no-deps --workspace --exclude tokio-tungstenite) .PHONY: clippy clippy: diff --git a/nautilus_core/accounting/src/account/mod.rs b/nautilus_core/accounting/src/account/mod.rs index 1d53aadca2f6..3aee414fe5f6 100644 --- a/nautilus_core/accounting/src/account/mod.rs +++ b/nautilus_core/accounting/src/account/mod.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Provides account types and accounting functionality. + pub mod base; pub mod cash; pub mod margin; diff --git a/nautilus_core/accounting/src/python/mod.rs b/nautilus_core/accounting/src/python/mod.rs index 6ca8aac3763b..63d245a4b45a 100644 --- a/nautilus_core/accounting/src/python/mod.rs +++ b/nautilus_core/accounting/src/python/mod.rs @@ -13,7 +13,7 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- -//! Provides Python bindings from `pyo3`. +//! Python bindings from `pyo3`. #![allow(warnings)] // non-local `impl` definition, temporary allow until pyo3 upgrade diff --git a/nautilus_core/adapters/src/databento/mod.rs b/nautilus_core/adapters/src/databento/mod.rs index 8b45d33b78f2..70880f3c5581 100644 --- a/nautilus_core/adapters/src/databento/mod.rs +++ b/nautilus_core/adapters/src/databento/mod.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Provides the [Databento](https://databento.com) integration adapter. + pub mod common; pub mod decode; pub mod enums; diff --git a/nautilus_core/adapters/src/databento/python/mod.rs b/nautilus_core/adapters/src/databento/python/mod.rs index ba75fdead4ac..bab30299cd7e 100644 --- a/nautilus_core/adapters/src/databento/python/mod.rs +++ b/nautilus_core/adapters/src/databento/python/mod.rs @@ -13,7 +13,7 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- -//! Provides Python bindings from `pyo3`. +//! Python bindings from `pyo3`. #![allow(warnings)] // non-local `impl` definition, temporary allow until pyo3 upgrade diff --git a/nautilus_core/backtest/src/engine.rs b/nautilus_core/backtest/src/engine.rs index 3ad0dabc8934..924de33c7b86 100644 --- a/nautilus_core/backtest/src/engine.rs +++ b/nautilus_core/backtest/src/engine.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! The core `BacktestEngine` for backtesting on historical data. + use std::ops::{Deref, DerefMut}; use nautilus_common::{clock::TestClock, ffi::clock::TestClock_API, timer::TimeEventHandler}; diff --git a/nautilus_core/backtest/src/matching_engine.rs b/nautilus_core/backtest/src/matching_engine.rs index 63d03639962b..46a8c7caa688 100644 --- a/nautilus_core/backtest/src/matching_engine.rs +++ b/nautilus_core/backtest/src/matching_engine.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Provides an `OrderMatchingEngine` for use in research, backtesting and sandbox environments. + // Under development #![allow(dead_code)] #![allow(unused_variables)] diff --git a/nautilus_core/common/src/cache/mod.rs b/nautilus_core/common/src/cache/mod.rs index 4a85ce5829dc..3864f3a9fc84 100644 --- a/nautilus_core/common/src/cache/mod.rs +++ b/nautilus_core/common/src/cache/mod.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! A common in-memory `Cache` for market and execution related data. + // Under development #![allow(dead_code)] #![allow(unused_variables)] diff --git a/nautilus_core/common/src/clock.rs b/nautilus_core/common/src/clock.rs index 8f7829441a8f..de5f37ac4b37 100644 --- a/nautilus_core/common/src/clock.rs +++ b/nautilus_core/common/src/clock.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Provides real-time and static test `Clock` implementations. + use std::{collections::HashMap, ops::Deref}; use nautilus_core::{ diff --git a/nautilus_core/common/src/enums.rs b/nautilus_core/common/src/enums.rs index bb38656e456a..4a302e786bcc 100644 --- a/nautilus_core/common/src/enums.rs +++ b/nautilus_core/common/src/enums.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Defines common enumerations. + use std::fmt::Debug; use serde::{Deserialize, Serialize}; diff --git a/nautilus_core/common/src/factories.rs b/nautilus_core/common/src/factories.rs index eff962784ae9..68725fff29a6 100644 --- a/nautilus_core/common/src/factories.rs +++ b/nautilus_core/common/src/factories.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Provides factories for constructing domain objects such as orders. + use std::collections::HashMap; use nautilus_core::{time::AtomicTime, uuid::UUID4}; diff --git a/nautilus_core/common/src/generators/mod.rs b/nautilus_core/common/src/generators/mod.rs index 9df51c6a20cc..77a829abd4ef 100644 --- a/nautilus_core/common/src/generators/mod.rs +++ b/nautilus_core/common/src/generators/mod.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Provides generation of identifiers such as `ClientOrderId` and `PositionId`. + pub mod client_order_id; pub mod order_list_id; pub mod position_id; diff --git a/nautilus_core/common/src/handlers.rs b/nautilus_core/common/src/handlers.rs index 85694cb2ede0..1ebbcd39f38d 100644 --- a/nautilus_core/common/src/handlers.rs +++ b/nautilus_core/common/src/handlers.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Provides common message handlers. + #[cfg(not(feature = "python"))] use std::ffi::c_char; use std::{fmt, sync::Arc}; diff --git a/nautilus_core/common/src/interface/mod.rs b/nautilus_core/common/src/interface/mod.rs index ba41ba2b9861..718b12cd4e7a 100644 --- a/nautilus_core/common/src/interface/mod.rs +++ b/nautilus_core/common/src/interface/mod.rs @@ -13,4 +13,6 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Interface traits to faciliate a ports and adapters style architecture. + pub mod account; diff --git a/nautilus_core/common/src/logging/mod.rs b/nautilus_core/common/src/logging/mod.rs index 1943acc1f892..01b1a29da819 100644 --- a/nautilus_core/common/src/logging/mod.rs +++ b/nautilus_core/common/src/logging/mod.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! The logging framework for Nautilus systems. + use std::{ collections::HashMap, env, diff --git a/nautilus_core/common/src/msgbus/mod.rs b/nautilus_core/common/src/msgbus/mod.rs index 50a9fb0ed67a..63ec48f78fb3 100644 --- a/nautilus_core/common/src/msgbus/mod.rs +++ b/nautilus_core/common/src/msgbus/mod.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! A common in-memory `MessageBus` for loosely coupled message passing patterns. + pub mod database; use std::{ diff --git a/nautilus_core/common/src/python/mod.rs b/nautilus_core/common/src/python/mod.rs index 26d2a21b6315..19636d0daac3 100644 --- a/nautilus_core/common/src/python/mod.rs +++ b/nautilus_core/common/src/python/mod.rs @@ -13,7 +13,7 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- -//! Provides Python bindings from `pyo3`. +//! Python bindings from `pyo3`. #![allow(warnings)] // non-local `impl` definition, temporary allow until pyo3 upgrade diff --git a/nautilus_core/common/src/runtime.rs b/nautilus_core/common/src/runtime.rs index 98dd9fc4a54c..e370bf5eeff5 100644 --- a/nautilus_core/common/src/runtime.rs +++ b/nautilus_core/common/src/runtime.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! The centralized Tokio runtime for a running Nautilus system. + use std::sync::OnceLock; use tokio::runtime::Runtime; diff --git a/nautilus_core/common/src/stubs.rs b/nautilus_core/common/src/stubs.rs index 063511b9bfa3..abb5dd10e958 100644 --- a/nautilus_core/common/src/stubs.rs +++ b/nautilus_core/common/src/stubs.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Type stubs to facilitate testing. + use nautilus_core::time::get_atomic_clock_static; use nautilus_model::identifiers::stubs::{strategy_id_ema_cross, trader_id}; use rstest::fixture; diff --git a/nautilus_core/common/src/testing.rs b/nautilus_core/common/src/testing.rs index dc108d1f0528..cf60ac7f4ee4 100644 --- a/nautilus_core/common/src/testing.rs +++ b/nautilus_core/common/src/testing.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Common test related helper functions. + use std::{ thread, time::{Duration, Instant}, diff --git a/nautilus_core/common/src/timer.rs b/nautilus_core/common/src/timer.rs index 94bd18a88597..94d899840691 100644 --- a/nautilus_core/common/src/timer.rs +++ b/nautilus_core/common/src/timer.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Provides real-time and test timers for use with `Clock` implementations. + use std::{ cmp::Ordering, ffi::c_char, diff --git a/nautilus_core/core/src/python/mod.rs b/nautilus_core/core/src/python/mod.rs index 0178025f5d1f..bb534ee78e38 100644 --- a/nautilus_core/core/src/python/mod.rs +++ b/nautilus_core/core/src/python/mod.rs @@ -13,7 +13,7 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- -//! Provides Python bindings from `pyo3`. +//! Python bindings from `pyo3`. #![allow(warnings)] // non-local `impl` definition, temporary allow until pyo3 upgrade diff --git a/nautilus_core/core/src/uuid.rs b/nautilus_core/core/src/uuid.rs index c4c0cc53d0b7..5e90fdbf0ddf 100644 --- a/nautilus_core/core/src/uuid.rs +++ b/nautilus_core/core/src/uuid.rs @@ -13,8 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- -//! Defines a core `UUID4` universally unique identifier (UUID) version 4 based on a 128-bit -//! label as specified in RFC 4122. +//! A core `UUID4` universally unique identifier (UUID) version 4 based on a 128-bit +//! label (RFC 4122). use std::{ ffi::{CStr, CString}, diff --git a/nautilus_core/execution/src/client.rs b/nautilus_core/execution/src/client.rs index 7987561c79dd..8abdc660c82a 100644 --- a/nautilus_core/execution/src/client.rs +++ b/nautilus_core/execution/src/client.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Provides execution client base functionality. + // Under development #![allow(dead_code)] #![allow(unused_variables)] diff --git a/nautilus_core/execution/src/engine.rs b/nautilus_core/execution/src/engine.rs index 0dedaa62594f..aa3a87d2d756 100644 --- a/nautilus_core/execution/src/engine.rs +++ b/nautilus_core/execution/src/engine.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Provides a generic `ExecutionEngine` for backtesting and live environments. + // Under development #![allow(dead_code)] #![allow(unused_variables)] diff --git a/nautilus_core/execution/src/matching_core.rs b/nautilus_core/execution/src/matching_core.rs index ecd17ddb017e..fb96f99087c3 100644 --- a/nautilus_core/execution/src/matching_core.rs +++ b/nautilus_core/execution/src/matching_core.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! A common `OrderMatchingCore` for the `OrderMatchingEngine` and other components. + // Under development #![allow(dead_code)] #![allow(unused_variables)] diff --git a/nautilus_core/execution/src/messages/mod.rs b/nautilus_core/execution/src/messages/mod.rs index 7fae514754b5..c4f34ebd76d4 100644 --- a/nautilus_core/execution/src/messages/mod.rs +++ b/nautilus_core/execution/src/messages/mod.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Defines execution specific messages such as order commands. + use nautilus_model::identifiers::{client_id::ClientId, instrument_id::InstrumentId}; use strum::Display; diff --git a/nautilus_core/indicators/src/average/mod.rs b/nautilus_core/indicators/src/average/mod.rs index 80e3259d5e45..95db06550fba 100644 --- a/nautilus_core/indicators/src/average/mod.rs +++ b/nautilus_core/indicators/src/average/mod.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Moving average type indicators. + use nautilus_model::enums::PriceType; use strum::{AsRefStr, Display, EnumIter, EnumString, FromRepr}; diff --git a/nautilus_core/indicators/src/book/mod.rs b/nautilus_core/indicators/src/book/mod.rs index 030ac78385ce..49266242da96 100644 --- a/nautilus_core/indicators/src/book/mod.rs +++ b/nautilus_core/indicators/src/book/mod.rs @@ -13,4 +13,6 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Order book specific indicators. + pub mod imbalance; diff --git a/nautilus_core/indicators/src/indicator.rs b/nautilus_core/indicators/src/indicator.rs index 98fccd870c0d..99b6d73020b8 100644 --- a/nautilus_core/indicators/src/indicator.rs +++ b/nautilus_core/indicators/src/indicator.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Defines a common `Indicator` trait. + use std::{fmt, fmt::Debug}; use nautilus_model::{ diff --git a/nautilus_core/indicators/src/momentum/mod.rs b/nautilus_core/indicators/src/momentum/mod.rs index 7ace632bf2db..6a11fd173c08 100644 --- a/nautilus_core/indicators/src/momentum/mod.rs +++ b/nautilus_core/indicators/src/momentum/mod.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Momentum type indicators. + pub mod aroon; pub mod bias; pub mod cmo; diff --git a/nautilus_core/indicators/src/python/mod.rs b/nautilus_core/indicators/src/python/mod.rs index d0a91df07f62..ed63431a324e 100644 --- a/nautilus_core/indicators/src/python/mod.rs +++ b/nautilus_core/indicators/src/python/mod.rs @@ -13,7 +13,7 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- -//! Provides Python bindings from `pyo3`. +//! Python bindings from `pyo3`. #![allow(warnings)] // non-local `impl` definition, temporary allow until pyo3 upgrade diff --git a/nautilus_core/indicators/src/ratio/mod.rs b/nautilus_core/indicators/src/ratio/mod.rs index 5ca24611bf69..e13423493fad 100644 --- a/nautilus_core/indicators/src/ratio/mod.rs +++ b/nautilus_core/indicators/src/ratio/mod.rs @@ -13,4 +13,6 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Ratio type indicators. + pub mod efficiency_ratio; diff --git a/nautilus_core/indicators/src/stubs.rs b/nautilus_core/indicators/src/stubs.rs index 04c6d2fc8d0e..610b90805abe 100644 --- a/nautilus_core/indicators/src/stubs.rs +++ b/nautilus_core/indicators/src/stubs.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Type stubs to facilitate testing. + use nautilus_model::{ data::{ bar::{Bar, BarSpecification, BarType}, diff --git a/nautilus_core/indicators/src/testing.rs b/nautilus_core/indicators/src/testing.rs index aa5614689b84..b6427b0b22e0 100644 --- a/nautilus_core/indicators/src/testing.rs +++ b/nautilus_core/indicators/src/testing.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Common test related helper functions. + /// Checks if two floating-point numbers are approximately equal within the /// margin of floating-point precision. /// diff --git a/nautilus_core/indicators/src/volatility/mod.rs b/nautilus_core/indicators/src/volatility/mod.rs index 799b0bb38a10..aac24710eae5 100644 --- a/nautilus_core/indicators/src/volatility/mod.rs +++ b/nautilus_core/indicators/src/volatility/mod.rs @@ -13,4 +13,6 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Volatility type indicators. + pub mod atr; diff --git a/nautilus_core/infrastructure/src/lib.rs b/nautilus_core/infrastructure/src/lib.rs index 1724ca9ee60c..6f87ec9dc619 100644 --- a/nautilus_core/infrastructure/src/lib.rs +++ b/nautilus_core/infrastructure/src/lib.rs @@ -26,6 +26,7 @@ //! //! - `python`: Enables Python bindings from `pyo3` //! - `redis`: Enables the Redis cache database and message bus backing implementations +//! - `sql`: Enables the SQL models and cache database #[cfg(feature = "python")] pub mod python; diff --git a/nautilus_core/infrastructure/src/python/mod.rs b/nautilus_core/infrastructure/src/python/mod.rs index e4d266e0f9b7..6c07e5f0dbfc 100644 --- a/nautilus_core/infrastructure/src/python/mod.rs +++ b/nautilus_core/infrastructure/src/python/mod.rs @@ -13,7 +13,7 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- -//! Provides Python bindings from `pyo3`. +//! Python bindings from `pyo3`. #[cfg(feature = "redis")] pub mod redis; diff --git a/nautilus_core/infrastructure/src/redis/mod.rs b/nautilus_core/infrastructure/src/redis/mod.rs index fc9e3aa59792..24b945aed94b 100644 --- a/nautilus_core/infrastructure/src/redis/mod.rs +++ b/nautilus_core/infrastructure/src/redis/mod.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Provides a Redis backed `CacheDatabase` and `MessageBusDatabase` implementation. + pub mod cache; pub mod msgbus; diff --git a/nautilus_core/infrastructure/src/sql/mod.rs b/nautilus_core/infrastructure/src/sql/mod.rs index cf32d3bfc0e9..2df57cccc3be 100644 --- a/nautilus_core/infrastructure/src/sql/mod.rs +++ b/nautilus_core/infrastructure/src/sql/mod.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Provides a SQL data model and `CacheDatabase` implementation. + pub mod cache; pub mod database; pub mod models; diff --git a/nautilus_core/model/src/currencies.rs b/nautilus_core/model/src/currencies.rs index 02b1b8a5ff46..2a75caab5fbe 100644 --- a/nautilus_core/model/src/currencies.rs +++ b/nautilus_core/model/src/currencies.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Common `Currency` constants. + use std::{ collections::HashMap, sync::{Mutex, OnceLock}, diff --git a/nautilus_core/model/src/data/mod.rs b/nautilus_core/model/src/data/mod.rs index 19a0564debc4..948ce4cf00f8 100644 --- a/nautilus_core/model/src/data/mod.rs +++ b/nautilus_core/model/src/data/mod.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Defines `Data` types for the trading domain model. + pub mod bar; pub mod delta; pub mod deltas; diff --git a/nautilus_core/model/src/events/mod.rs b/nautilus_core/model/src/events/mod.rs index 718817de89d0..bc27a5283ee9 100644 --- a/nautilus_core/model/src/events/mod.rs +++ b/nautilus_core/model/src/events/mod.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Defines order, position and account events for the trading domain model. + pub mod account; pub mod order; pub mod position; diff --git a/nautilus_core/model/src/identifiers/mod.rs b/nautilus_core/model/src/identifiers/mod.rs index d952191a2f75..2439bb019933 100644 --- a/nautilus_core/model/src/identifiers/mod.rs +++ b/nautilus_core/model/src/identifiers/mod.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Defines identifiers for the trading domain models. + use std::str::FromStr; use serde::{Deserialize, Deserializer, Serialize, Serializer}; diff --git a/nautilus_core/model/src/instruments/mod.rs b/nautilus_core/model/src/instruments/mod.rs index 677157372c89..9e5f43adb069 100644 --- a/nautilus_core/model/src/instruments/mod.rs +++ b/nautilus_core/model/src/instruments/mod.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Defines instrument definitions for the trading domain models. + pub mod crypto_future; pub mod crypto_perpetual; pub mod currency_pair; diff --git a/nautilus_core/model/src/macros.rs b/nautilus_core/model/src/macros.rs index b59ae112a045..9f7e0847d503 100644 --- a/nautilus_core/model/src/macros.rs +++ b/nautilus_core/model/src/macros.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Model specific macros. + #[macro_export] macro_rules! enum_strum_serde { ($type:ty) => { diff --git a/nautilus_core/model/src/orderbook/mod.rs b/nautilus_core/model/src/orderbook/mod.rs index ebadfa649427..d42aff96dbea 100644 --- a/nautilus_core/model/src/orderbook/mod.rs +++ b/nautilus_core/model/src/orderbook/mod.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Provides a generic order book which can handle L1/L2/L3 data. + pub mod aggregation; pub mod analysis; pub mod book; diff --git a/nautilus_core/model/src/orders/mod.rs b/nautilus_core/model/src/orders/mod.rs index 8a58c59e8aa8..59027c636043 100644 --- a/nautilus_core/model/src/orders/mod.rs +++ b/nautilus_core/model/src/orders/mod.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Defines order types for the trading domain model. + #![allow(dead_code)] pub mod base; diff --git a/nautilus_core/model/src/polymorphism.rs b/nautilus_core/model/src/polymorphism.rs index 9d80c3685202..a1e703c69f64 100644 --- a/nautilus_core/model/src/polymorphism.rs +++ b/nautilus_core/model/src/polymorphism.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Defines traits to faciliate polymorphism. + use nautilus_core::nanos::UnixNanos; use crate::{ diff --git a/nautilus_core/model/src/position.rs b/nautilus_core/model/src/position.rs index 9921bbaa2acc..71be2472e420 100644 --- a/nautilus_core/model/src/position.rs +++ b/nautilus_core/model/src/position.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Defines a `Position` for the trading domain model. + use std::{ collections::{HashMap, HashSet}, fmt::Display, diff --git a/nautilus_core/model/src/python/mod.rs b/nautilus_core/model/src/python/mod.rs index 9371a2c5f8c4..3a96310f7ca7 100644 --- a/nautilus_core/model/src/python/mod.rs +++ b/nautilus_core/model/src/python/mod.rs @@ -13,7 +13,7 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- -//! Provides Python bindings from `pyo3`. +//! Python bindings from `pyo3`. #![allow(warnings)] // non-local `impl` definition, temporary allow until pyo3 upgrade diff --git a/nautilus_core/model/src/stubs.rs b/nautilus_core/model/src/stubs.rs index 1fa1bf8855c7..abe380c5889f 100644 --- a/nautilus_core/model/src/stubs.rs +++ b/nautilus_core/model/src/stubs.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Type stubs to facilitate testing. + use rstest::fixture; use rust_decimal::prelude::ToPrimitive; diff --git a/nautilus_core/model/src/types/mod.rs b/nautilus_core/model/src/types/mod.rs index f5e1c1e4ca32..3d34dffa31c5 100644 --- a/nautilus_core/model/src/types/mod.rs +++ b/nautilus_core/model/src/types/mod.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Defines value types for the trading domain model such as `Price`, `Quantity` and `Money`. + pub mod balance; pub mod currency; pub mod fixed; diff --git a/nautilus_core/model/src/venues.rs b/nautilus_core/model/src/venues.rs index b479f2207bce..536fc4c48171 100644 --- a/nautilus_core/model/src/venues.rs +++ b/nautilus_core/model/src/venues.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Common `Venue` constants. + use std::{ collections::HashMap, sync::{Mutex, OnceLock}, diff --git a/nautilus_core/network/src/http.rs b/nautilus_core/network/src/http.rs index b6957a27cd0a..2116c7d60de7 100644 --- a/nautilus_core/network/src/http.rs +++ b/nautilus_core/network/src/http.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Provides a high-performance HTTP client implementation. + use std::{ collections::{hash_map::DefaultHasher, HashMap}, hash::{Hash, Hasher}, diff --git a/nautilus_core/network/src/python/mod.rs b/nautilus_core/network/src/python/mod.rs index 6dc97869eae9..a0fa1ffcb031 100644 --- a/nautilus_core/network/src/python/mod.rs +++ b/nautilus_core/network/src/python/mod.rs @@ -13,7 +13,7 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- -//! Provides Python bindings from `pyo3`. +//! Python bindings from `pyo3`. use pyo3::prelude::*; diff --git a/nautilus_core/network/src/socket.rs b/nautilus_core/network/src/socket.rs index fc88bf6cb895..9db1bfbde901 100644 --- a/nautilus_core/network/src/socket.rs +++ b/nautilus_core/network/src/socket.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Provides a high-performance raw TCP client implementation with TLS capability. + use std::{sync::Arc, time::Duration}; use nautilus_core::python::to_pyruntime_err; diff --git a/nautilus_core/network/src/websocket.rs b/nautilus_core/network/src/websocket.rs index 0bc4e0f6ec30..a0dda5dca218 100644 --- a/nautilus_core/network/src/websocket.rs +++ b/nautilus_core/network/src/websocket.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Provides a high-performance WebSocket client implementation. + use std::{str::FromStr, sync::Arc, time::Duration}; use futures_util::{ diff --git a/nautilus_core/persistence/src/arrow/mod.rs b/nautilus_core/persistence/src/arrow/mod.rs index 45a8adcd26b0..42b76c3033d1 100644 --- a/nautilus_core/persistence/src/arrow/mod.rs +++ b/nautilus_core/persistence/src/arrow/mod.rs @@ -13,6 +13,8 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Defines the Apache Arrow schema for Nautilus types. + pub mod bar; pub mod delta; pub mod depth; diff --git a/nautilus_core/persistence/src/backend/mod.rs b/nautilus_core/persistence/src/backend/mod.rs index b98400745205..10062490b8d6 100644 --- a/nautilus_core/persistence/src/backend/mod.rs +++ b/nautilus_core/persistence/src/backend/mod.rs @@ -13,5 +13,7 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- +//! Provides an Apache Parquet backend powered by [DataFusion](https://arrow.apache.org/datafusion). + pub mod kmerge_batch; pub mod session; diff --git a/nautilus_core/persistence/src/python/mod.rs b/nautilus_core/persistence/src/python/mod.rs index 59117f8e9e63..a02aefc0630b 100644 --- a/nautilus_core/persistence/src/python/mod.rs +++ b/nautilus_core/persistence/src/python/mod.rs @@ -13,7 +13,7 @@ // limitations under the License. // ------------------------------------------------------------------------------------------------- -//! Provides Python bindings from `pyo3`. +//! Python bindings from `pyo3`. #![allow(warnings)] // non-local `impl` definition, temporary allow until pyo3 upgrade