Expand description
Core foundational types and utilities for NautilusTrader.
The nautilus-core
crate is designed to be lightweight, efficient, and to provide zero-cost abstractions
wherever possible. It supplies the essential building blocks used across the NautilusTrader
ecosystem, including:
- Time handling and atomic clock functionality.
- UUID generation and management.
- Mathematical functions and interpolation utilities.
- Correctness validation functions.
- Serialization traits and helpers.
- Cross-platform environment utilities.
- Abstractions over common collections.
§Platform
NautilusTrader is an open-source, high-performance, production-grade algorithmic trading platform, providing quantitative traders with the ability to backtest portfolios of automated trading strategies on historical data with an event-driven engine, and also deploy those same strategies live, with no code changes.
NautilusTrader’s design, architecture, and implementation philosophy prioritizes software correctness and safety at the highest level, with the aim of supporting mission-critical, trading system backtesting and live deployment workloads.
§Feature flags
This crate provides feature flags to control source code inclusion during compilation, depending on the intended use case, i.e. whether to provide Python bindings for the nautilus_trader Python package, or as part of a Rust only build.
Re-exports§
pub use crate::drop::CleanDrop;
pub use crate::nanos::UnixNanos;
pub use crate::shared::WeakCell;
pub use crate::time::AtomicTime;
pub use crate::uuid::UUID4;
Modules§
- collections
- Abstraction layer over common hash-based containers.
- consts
- Core constants.
- correctness
- Functions for correctness checks similar to the design by contract philosophy.
- datetime
- Common data and time functions.
- drop
- Explicit, manually-invocable cleanup hook used to break reference cycles before
Drop
. - env
- Cross-platform environment variable utilities.
- ffi
- C foreign function interface (FFI) from cbindgen.
- math
- Mathematical functions and interpolation utilities.
- message
- Common message types.
- nanos
- A
UnixNanos
type for working with timestamps in nanoseconds since the UNIX epoch. - parsing
- Core parsing functions.
- paths
- Utility functions for resolving project and workspace directory paths.
- python
- Python bindings and interoperability built using
PyO3
. - serialization
- Common serialization traits and functions.
- shared
- Efficient and ergonomic wrappers around frequently-used
Rc<RefCell<T>>
/Weak<RefCell<T>>
pairs. - time
- The core
AtomicTime
for real-time and static clocks. - uuid
- A
UUID4
Universally Unique Identifier (UUID) version 4 (RFC 4122).
Macros§
- approx_
eq - Macro for approximate floating-point equality comparison.