nt_core/lib.rs
1//! # NT-Core: Neural Trader Core Library
2//!
3//! This crate provides the foundational types, traits, and utilities for the Neural Trading system.
4//! It has zero domain-specific dependencies and serves as the base for all other crates.
5//!
6//! ## Features
7//!
8//! - **Zero-cost abstractions**: Generic traits with no runtime overhead
9//! - **Type safety**: Strong typing for financial primitives (Symbol, Price, etc.)
10//! - **Async-first**: All I/O operations use `async/await`
11//! - **Error handling**: Comprehensive error types with context
12//! - **Serialization**: Full serde support for all types
13//!
14//! ## Architecture
15//!
16//! ```text
17//! nt-core
18//! ├── types - Core financial types (Symbol, Price, Order, etc.)
19//! ├── traits - Async traits for strategies, data providers, execution
20//! ├── error - Unified error handling with thiserror
21//! └── config - Configuration management with validation
22//! ```
23//!
24//! ## Example Usage
25//!
26//! ```rust
27//! use nt_core::prelude::*;
28//!
29//! // Create a symbol
30//! let symbol = Symbol::new("AAPL").unwrap();
31//!
32//! // Create a trading signal
33//! let signal = Signal::new(
34//! "momentum_strategy",
35//! symbol.clone(),
36//! Direction::Long,
37//! 0.85,
38//! );
39//!
40//! println!("Signal: {:?}", signal);
41//! ```
42
43pub mod config;
44pub mod error;
45pub mod traits;
46pub mod types;
47
48/// Commonly used types and traits
49pub mod prelude {
50 pub use crate::config::*;
51 pub use crate::error::{Result, TradingError};
52 pub use crate::traits::*;
53 pub use crate::types::*;
54}