Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Avhz RustQuant Prelude

From Leeroopedia


Knowledge Sources
Domains Library_Organization, Quantitative_Finance
Last Updated 2026-02-07 19:00 GMT

Overview

Concrete tool for the main crate entry point and prelude module that re-exports all RustQuant sub-crates provided by the RustQuant library.

Description

The RustQuant main crate (crates/RustQuant/src/lib.rs) serves as the unified entry point for the entire library, re-exporting all sub-crates as named modules. It defines a prelude module that glob-imports every sub-crate, allowing users to bring all types into scope with a single import. The crate enforces strict documentation (#![forbid(missing_docs)]), allows non-snake-case names for mathematical notation (#![allow(non_snake_case)]), and requires safety comments for any unsafe code (#![forbid(clippy::undocumented_unsafe_blocks)]). Thirteen sub-modules are re-exported: autodiff (automatic differentiation), cashflows (cashflow modeling), data (market data structures), error (error handling), instruments (financial instruments), iso (ISO standards), math (mathematical utilities), ml (machine learning), portfolios (portfolio management), stochastics (stochastic processes), time (calendar and date functions), trading (order book and trading), and utils (utility macros). Each module simply re-exports everything from its corresponding RustQuant_* sub-crate.

Usage

Use RustQuant::prelude::* for convenience when you want all library types in scope, or import specific sub-modules (e.g., RustQuant::trading::OrderBook) for more targeted usage. This is the standard entry point for any project depending on the RustQuant crate.

Code Reference

Source Location

Signature

pub mod prelude {
    pub use RustQuant_autodiff::*;
    pub use RustQuant_cashflows::*;
    pub use RustQuant_data::*;
    pub use RustQuant_error::*;
    pub use RustQuant_instruments::*;
    pub use RustQuant_iso::*;
    pub use RustQuant_math::*;
    pub use RustQuant_ml::*;
    pub use RustQuant_portfolios::*;
    pub use RustQuant_stochastics::*;
    pub use RustQuant_time::*;
    pub use RustQuant_trading::*;
    pub use RustQuant_utils::*;
}

pub mod autodiff { pub use RustQuant_autodiff::*; }
pub mod cashflows { pub use RustQuant_cashflows::*; }
pub mod data { pub use RustQuant_data::*; }
pub mod error { pub use RustQuant_error::*; }
pub mod instruments { pub use RustQuant_instruments::*; }
pub mod iso { pub use RustQuant_iso::*; }
pub mod math { pub use RustQuant_math::*; }
pub mod ml { pub use RustQuant_ml::*; }
pub mod portfolios { pub use RustQuant_portfolios::*; }
pub mod stochastics { pub use RustQuant_stochastics::*; }
pub mod time { pub use RustQuant_time::*; }
pub mod trading { pub use RustQuant_trading::*; }
pub mod utils { pub use RustQuant_utils::*; }

Import

// Import everything via prelude
use RustQuant::prelude::*;

// Or import specific modules
use RustQuant::trading::OrderBook;
use RustQuant::cashflows::Cashflow;
use RustQuant::iso::ISO_4217;

I/O Contract

Inputs

Name Type Required Description
N/A N/A N/A This is a re-export module with no direct inputs

Outputs

Name Type Description
prelude module Glob re-export of all 13 sub-crates
autodiff module Automatic differentiation (RustQuant_autodiff)
cashflows module Cashflow modeling (RustQuant_cashflows)
data module Market data structures (RustQuant_data)
error module Error handling (RustQuant_error)
instruments module Financial instruments (RustQuant_instruments)
iso module ISO standards (RustQuant_iso)
math module Mathematical utilities (RustQuant_math)
ml module Machine learning (RustQuant_ml)
portfolios module Portfolio management (RustQuant_portfolios)
stochastics module Stochastic processes (RustQuant_stochastics)
time module Calendar and date functions (RustQuant_time)
trading module Order book and trading (RustQuant_trading)
utils module Utility macros (RustQuant_utils)

Usage Examples

// Approach 1: Import everything via prelude
use RustQuant::prelude::*;

// Now all types are available directly
let cashflow = Cashflow::new(100.0, time::OffsetDateTime::now_utc().date());

// Approach 2: Import specific modules
use RustQuant::trading::{OrderBook, Order, OrderSide, OrderType};
use RustQuant::cashflows::{Cashflow, Leg};
use RustQuant::iso::{ISO_4217, ISO_3166};
use RustQuant::error::RustQuantError;

// Approach 3: Install via cargo
// cargo add RustQuant
// or in Cargo.toml:
// [dependencies]
// RustQuant = "*"

Related Pages

This is the library entry point with no associated principle page.

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment