Skip to main content

Module util

Module util 

Source
Expand description

Shared utilities: errors, validation helpers, domain newtypes, root-finding.

Modules§

error
Error types and validation for finance calculations.
primitives
Domain newtypes — zero-cost wrappers that make invalid values harder to pass by accident.
root_find
Scalar root-finding helpers used by implied vol and other solvers.

Structs§

Money
Finite signed monetary amount (no currency unit — pure magnitude + sign).
PeriodLength
Positive lookback / window length for technical indicators (usize ≥ 1).
Periods
Count of compounding / payment periods (u32).
PositivePrice
Strictly positive finite price (or similar quantity used as a price level).
Rate
Periodic or continuous interest / return rate as a decimal (e.g. 0.05 = 5%).

Enums§

FinanceError
Domain and input errors from finance calculations.

Functions§

brent_root
Find a root of continuous f on bracket [lo, hi] (Brent 1973).

Type Aliases§

FinanceResult
Result alias for fallible finance functions.