Skip to content

Rust API

The numerics live in the Rust core crate, libitofin. Its API reference is generated by rustdoc and published automatically on every crates.io release:

[:material-book-open-variant: **docs.rs/libitofin** :material-arrow-right:](https://docs.rs/libitofin){ .md-button .md-button--primary }

Why the Rust docs are hosted separately

  • rustdoc is the native tool. Rust API docs come from the /// doc comments on the source and render with full type links, trait implementations and source view. docs.rs builds them for you on publish, so there is nothing to duplicate here.
  • This site brings the language guides together. It renders Python .pyi stubs and links to native Rust and Go API references, while sharing runnable examples.

Add it to a Rust project

cargo add libitofin
use libitofin::time::Date;
use libitofin::settings::Settings;
// analytic option engines, curves and CDS pricing are available today - see docs.rs.

Numerical optimization

itofin-optimize is a separate, finance-independent crate with a SciPy-inspired minimize over plain f64 slices; it never depends on libitofin. Its objective trait carries its own error type, so a failing objective reaches the caller unchanged. It is not yet published on crates.io; Python reaches it as itofin.optimize and Go as itofin.Minimize.

Runnable Rust examples live in crates/libitofin/examples; the Python and Go introductions are on the Getting started page.