Skip to content

Commit 8dd3c5f

Browse files
committed
Add additional Rust docs
1 parent b8ce7ad commit 8dd3c5f

File tree

42 files changed

+227
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+227
-1
lines changed

nautilus_core/accounting/src/lib.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@
1313
// limitations under the License.
1414
// -------------------------------------------------------------------------------------------------
1515

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+
//! - `python`: Enables Python bindings from `pyo3`
28+
1629
pub mod account;
1730
#[cfg(test)]
1831
pub mod stubs;

nautilus_core/accounting/src/python/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
// limitations under the License.
1414
// -------------------------------------------------------------------------------------------------
1515

16+
//! Provides Python bindings from `pyo3`.
17+
1618
#![allow(warnings)] // non-local `impl` definition, temporary allow until pyo3 upgrade
1719

1820
use pyo3::{prelude::*, pymodule};

nautilus_core/adapters/src/databento/python/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
// limitations under the License.
1414
// -------------------------------------------------------------------------------------------------
1515

16+
//! Provides Python bindings from `pyo3`.
17+
1618
#![allow(warnings)] // non-local `impl` definition, temporary allow until pyo3 upgrade
1719

1820
pub mod enums;

nautilus_core/adapters/src/lib.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,20 @@
1313
// limitations under the License.
1414
// -------------------------------------------------------------------------------------------------
1515

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+
//! - `databento`: Includes the Databento integration adapter
28+
//! - `ffi`: Enables the C foreign function interface (FFI) from `cbindgen`
29+
//! - `python`: Enables Python bindings from `pyo3`
30+
1631
#[cfg(feature = "databento")]
1732
pub mod databento;

nautilus_core/backtest/src/lib.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,19 @@
1313
// limitations under the License.
1414
// -------------------------------------------------------------------------------------------------
1515

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+
1630
pub mod engine;
1731
pub mod matching_engine;

nautilus_core/common/src/ffi/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
// limitations under the License.
1414
// -------------------------------------------------------------------------------------------------
1515

16+
//! Provides a C foreign function interface (FFI) from `cbindgen`.
17+
1618
pub mod clock;
1719
pub mod enums;
1820
pub mod logging;

nautilus_core/common/src/lib.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,21 @@
1313
// limitations under the License.
1414
// -------------------------------------------------------------------------------------------------
1515

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+
//! - `stubs`: Enables type stubs for use in testing scenarios
30+
1631
pub mod cache;
1732
pub mod clock;
1833
pub mod enums;

nautilus_core/common/src/python/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
// limitations under the License.
1414
// -------------------------------------------------------------------------------------------------
1515

16+
//! Provides Python bindings from `pyo3`.
17+
1618
#![allow(warnings)] // non-local `impl` definition, temporary allow until pyo3 upgrade
1719

1820
pub mod clock;

nautilus_core/core/src/correctness.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// limitations under the License.
1414
// -------------------------------------------------------------------------------------------------
1515

16-
//! Defines static condition checks similar to the *design by contract* philosophy
16+
//! Provides static condition checks similar to the *design by contract* philosophy
1717
//! to help ensure logical correctness.
1818
//!
1919
//! This module provides validation checking of function or method conditions.

nautilus_core/core/src/datetime.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
// limitations under the License.
1414
// -------------------------------------------------------------------------------------------------
1515

16+
//! Provides common data and time functions.
17+
1618
use std::time::{Duration, UNIX_EPOCH};
1719

1820
use chrono::{

nautilus_core/core/src/ffi/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
// limitations under the License.
1414
// -------------------------------------------------------------------------------------------------
1515

16+
//! Provides a C foreign function interface (FFI) from `cbindgen`.
17+
1618
pub mod cvec;
1719
pub mod datetime;
1820
pub mod parsing;

nautilus_core/core/src/lib.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,20 @@
1313
// limitations under the License.
1414
// -------------------------------------------------------------------------------------------------
1515

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+
1630
pub mod correctness;
1731
pub mod datetime;
1832
pub mod message;

nautilus_core/core/src/message.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
// limitations under the License.
1414
// -------------------------------------------------------------------------------------------------
1515

16+
//! Defines common message types.
17+
1618
use crate::{nanos::UnixNanos, uuid::UUID4};
1719

1820
#[derive(Debug, Clone)]

nautilus_core/core/src/nanos.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
// limitations under the License.
1414
// -------------------------------------------------------------------------------------------------
1515

16+
//! Defines `UnixNanos` type for working with UNIX epoch (nanoseconds).
17+
1618
use std::{
1719
cmp::Ordering,
1820
fmt::Display,

nautilus_core/core/src/parsing.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
// limitations under the License.
1414
// -------------------------------------------------------------------------------------------------
1515

16+
//! Provides core parsing functions.
17+
1618
/// Returns the decimal precision inferred from the given string.
1719
#[must_use]
1820
pub fn precision_from_str(s: &str) -> u8 {

nautilus_core/core/src/python/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
// limitations under the License.
1414
// -------------------------------------------------------------------------------------------------
1515

16+
//! Provides Python bindings from `pyo3`.
17+
1618
#![allow(warnings)] // non-local `impl` definition, temporary allow until pyo3 upgrade
1719

1820
use std::fmt;

nautilus_core/core/src/serialization.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
// limitations under the License.
1414
// -------------------------------------------------------------------------------------------------
1515

16+
//! Defines common serialization traits.
17+
1618
use serde::{Deserialize, Serialize};
1719

1820
/// Represents types which are serializable for JSON and `MsgPack` specifications.

nautilus_core/core/src/time.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
// limitations under the License.
1414
// -------------------------------------------------------------------------------------------------
1515

16+
//! Provides the core `AtomicTime` real-time and static clocks.
17+
1618
use std::{
1719
ops::Deref,
1820
sync::{

nautilus_core/core/src/uuid.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
// limitations under the License.
1414
// -------------------------------------------------------------------------------------------------
1515

16+
//! Defines a core `UUID4` universally unique identifier (UUID) version 4 based on a 128-bit
17+
//! label as specified in RFC 4122.
18+
1619
use std::{
1720
ffi::{CStr, CString},
1821
fmt::{Debug, Display, Formatter},

nautilus_core/execution/src/lib.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,20 @@
1313
// limitations under the License.
1414
// -------------------------------------------------------------------------------------------------
1515

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+
1630
pub mod client;
1731
pub mod engine;
1832
pub mod matching_core;

nautilus_core/indicators/src/lib.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,19 @@
1313
// limitations under the License.
1414
// -------------------------------------------------------------------------------------------------
1515

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+
//! - `python`: Enables Python bindings from `pyo3`
28+
1629
pub mod average;
1730
pub mod book;
1831
pub mod indicator;

nautilus_core/indicators/src/python/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
// limitations under the License.
1414
// -------------------------------------------------------------------------------------------------
1515

16+
//! Provides Python bindings from `pyo3`.
17+
1618
#![allow(warnings)] // non-local `impl` definition, temporary allow until pyo3 upgrade
1719

1820
use pyo3::{prelude::*, pymodule};

nautilus_core/infrastructure/src/lib.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,20 @@
1313
// limitations under the License.
1414
// -------------------------------------------------------------------------------------------------
1515

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+
//! - `python`: Enables Python bindings from `pyo3`
28+
//! - `redis`: Enables the Redis cache database and message bus backing implementations
29+
1630
#[cfg(feature = "python")]
1731
pub mod python;
1832

nautilus_core/infrastructure/src/python/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
// limitations under the License.
1414
// -------------------------------------------------------------------------------------------------
1515

16+
//! Provides Python bindings from `pyo3`.
17+
1618
#![allow(warnings)] // non-local `impl` definition, temporary allow until pyo3 upgrade
1719

1820
use pyo3::{prelude::*, pymodule};

nautilus_core/infrastructure/src/python/redis/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,7 @@
1313
// limitations under the License.
1414
// -------------------------------------------------------------------------------------------------
1515

16+
//! Provides a Redis cache database and message bus backing.
17+
1618
pub mod cache;
1719
pub mod msgbus;

nautilus_core/model/src/ffi/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
// limitations under the License.
1414
// -------------------------------------------------------------------------------------------------
1515

16+
//! Provides a C foreign function interface (FFI) from `cbindgen`.
17+
1618
pub mod data;
1719
pub mod enums;
1820
pub mod events;

nautilus_core/model/src/lib.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,21 @@
1313
// limitations under the License.
1414
// -------------------------------------------------------------------------------------------------
1515

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+
//! - `stubs`: Enables type stubs for use in testing scenarios
30+
1631
pub mod currencies;
1732
pub mod data;
1833
pub mod enums;

nautilus_core/model/src/python/data/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
// limitations under the License.
1414
// -------------------------------------------------------------------------------------------------
1515

16+
//! Defines data types for the trading domain model.
17+
1618
pub mod bar;
1719
pub mod delta;
1820
pub mod deltas;

nautilus_core/model/src/python/enums.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
// limitations under the License.
1414
// -------------------------------------------------------------------------------------------------
1515

16+
//! Defines enumerations for the trading domain model.
17+
1618
use std::str::FromStr;
1719

1820
use nautilus_core::python::to_pyvalue_err;

nautilus_core/model/src/python/events/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,7 @@
1313
// limitations under the License.
1414
// -------------------------------------------------------------------------------------------------
1515

16+
//! Defines events for the trading domain model.
17+
1618
pub mod account;
1719
pub mod order;

nautilus_core/model/src/python/identifiers/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
// limitations under the License.
1414
// -------------------------------------------------------------------------------------------------
1515

16+
//! Defines identifiers the trading domain model.
17+
1618
use std::str::FromStr;
1719

1820
use nautilus_core::python::to_pyvalue_err;

nautilus_core/model/src/python/instruments/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
// limitations under the License.
1414
// -------------------------------------------------------------------------------------------------
1515

16+
//! Defines instrument definitions the trading domain model.
17+
1618
use nautilus_core::python::to_pyvalue_err;
1719
use pyo3::{IntoPy, PyObject, PyResult, Python};
1820

0 commit comments

Comments
 (0)