Skip to content

Commit

Permalink
Add additional Rust docs
Browse files Browse the repository at this point in the history
  • Loading branch information
cjdsellers committed Apr 21, 2024
1 parent 9acab20 commit c1fe038
Show file tree
Hide file tree
Showing 61 changed files with 111 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions nautilus_core/accounting/src/account/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// limitations under the License.
// -------------------------------------------------------------------------------------------------

//! Provides account types and accounting functionality.
pub mod base;
pub mod cash;
pub mod margin;
Expand Down
2 changes: 1 addition & 1 deletion nautilus_core/accounting/src/python/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions nautilus_core/adapters/src/databento/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion nautilus_core/adapters/src/databento/python/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions nautilus_core/backtest/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
2 changes: 2 additions & 0 deletions nautilus_core/backtest/src/matching_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 2 additions & 0 deletions nautilus_core/common/src/cache/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 2 additions & 0 deletions nautilus_core/common/src/clock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::{
Expand Down
2 changes: 2 additions & 0 deletions nautilus_core/common/src/enums.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// limitations under the License.
// -------------------------------------------------------------------------------------------------

//! Defines common enumerations.
use std::fmt::Debug;

use serde::{Deserialize, Serialize};
Expand Down
2 changes: 2 additions & 0 deletions nautilus_core/common/src/factories.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
2 changes: 2 additions & 0 deletions nautilus_core/common/src/generators/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions nautilus_core/common/src/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
2 changes: 2 additions & 0 deletions nautilus_core/common/src/interface/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@
// limitations under the License.
// -------------------------------------------------------------------------------------------------

//! Interface traits to faciliate a ports and adapters style architecture.
pub mod account;
2 changes: 2 additions & 0 deletions nautilus_core/common/src/logging/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// limitations under the License.
// -------------------------------------------------------------------------------------------------

//! The logging framework for Nautilus systems.
use std::{
collections::HashMap,
env,
Expand Down
2 changes: 2 additions & 0 deletions nautilus_core/common/src/msgbus/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// limitations under the License.
// -------------------------------------------------------------------------------------------------

//! A common in-memory `MessageBus` for loosely coupled message passing patterns.
pub mod database;

use std::{
Expand Down
2 changes: 1 addition & 1 deletion nautilus_core/common/src/python/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions nautilus_core/common/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions nautilus_core/common/src/stubs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions nautilus_core/common/src/testing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// limitations under the License.
// -------------------------------------------------------------------------------------------------

//! Common test related helper functions.
use std::{
thread,
time::{Duration, Instant},
Expand Down
2 changes: 2 additions & 0 deletions nautilus_core/common/src/timer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion nautilus_core/core/src/python/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions nautilus_core/core/src/uuid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down
2 changes: 2 additions & 0 deletions nautilus_core/execution/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// limitations under the License.
// -------------------------------------------------------------------------------------------------

//! Provides execution client base functionality.
// Under development
#![allow(dead_code)]
#![allow(unused_variables)]
Expand Down
2 changes: 2 additions & 0 deletions nautilus_core/execution/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 2 additions & 0 deletions nautilus_core/execution/src/matching_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
2 changes: 2 additions & 0 deletions nautilus_core/execution/src/messages/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 2 additions & 0 deletions nautilus_core/indicators/src/average/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// limitations under the License.
// -------------------------------------------------------------------------------------------------

//! Moving average type indicators.
use nautilus_model::enums::PriceType;
use strum::{AsRefStr, Display, EnumIter, EnumString, FromRepr};

Expand Down
2 changes: 2 additions & 0 deletions nautilus_core/indicators/src/book/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@
// limitations under the License.
// -------------------------------------------------------------------------------------------------

//! Order book specific indicators.
pub mod imbalance;
2 changes: 2 additions & 0 deletions nautilus_core/indicators/src/indicator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// limitations under the License.
// -------------------------------------------------------------------------------------------------

//! Defines a common `Indicator` trait.
use std::{fmt, fmt::Debug};

use nautilus_model::{
Expand Down
2 changes: 2 additions & 0 deletions nautilus_core/indicators/src/momentum/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// limitations under the License.
// -------------------------------------------------------------------------------------------------

//! Momentum type indicators.
pub mod aroon;
pub mod bias;
pub mod cmo;
Expand Down
2 changes: 1 addition & 1 deletion nautilus_core/indicators/src/python/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions nautilus_core/indicators/src/ratio/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@
// limitations under the License.
// -------------------------------------------------------------------------------------------------

//! Ratio type indicators.
pub mod efficiency_ratio;
2 changes: 2 additions & 0 deletions nautilus_core/indicators/src/stubs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// limitations under the License.
// -------------------------------------------------------------------------------------------------

//! Type stubs to facilitate testing.
use nautilus_model::{
data::{
bar::{Bar, BarSpecification, BarType},
Expand Down
2 changes: 2 additions & 0 deletions nautilus_core/indicators/src/testing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down
2 changes: 2 additions & 0 deletions nautilus_core/indicators/src/volatility/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@
// limitations under the License.
// -------------------------------------------------------------------------------------------------

//! Volatility type indicators.
pub mod atr;
1 change: 1 addition & 0 deletions nautilus_core/infrastructure/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion nautilus_core/infrastructure/src/python/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// limitations under the License.
// -------------------------------------------------------------------------------------------------

//! Provides Python bindings from `pyo3`.
//! Python bindings from `pyo3`.
#[cfg(feature = "redis")]
pub mod redis;
Expand Down
2 changes: 2 additions & 0 deletions nautilus_core/infrastructure/src/redis/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// limitations under the License.
// -------------------------------------------------------------------------------------------------

//! Provides a Redis backed `CacheDatabase` and `MessageBusDatabase` implementation.
pub mod cache;
pub mod msgbus;

Expand Down
2 changes: 2 additions & 0 deletions nautilus_core/infrastructure/src/sql/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions nautilus_core/model/src/currencies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
// limitations under the License.
// -------------------------------------------------------------------------------------------------

//! Common `Currency` constants.
use std::{
collections::HashMap,
sync::{Mutex, OnceLock},
Expand Down
2 changes: 2 additions & 0 deletions nautilus_core/model/src/data/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions nautilus_core/model/src/events/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
2 changes: 2 additions & 0 deletions nautilus_core/model/src/identifiers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
2 changes: 2 additions & 0 deletions nautilus_core/model/src/instruments/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading

0 comments on commit c1fe038

Please sign in to comment.