rustledger-core
Core types for the rustledger Beancount implementation.
Key Types
| Type | Description |
|---|---|
Amount |
Decimal number with currency (e.g., 100.00 USD) |
Position |
Units held at a specific cost |
Inventory |
Collection of positions with booking support |
Cost |
Acquisition cost of a lot |
CostSpec |
Specification for matching or creating costs |
BookingMethod |
Lot matching strategy (FIFO, LIFO, HIFO, etc.) |
Directive |
All directive types (Transaction, Balance, Open, etc.) |
Example
use ;
use dec;
use NaiveDate;
let mut inv = new;
// Add a stock position
let cost = new
.with_date;
inv.add;
// Sell using FIFO
let result = inv.reduce.unwrap;
assert_eq!;
Features
rkyv(default) - Enable rkyv serialization for binary caching
License
GPL-3.0