Skip to main content

Crate bookkeeping

Crate bookkeeping 

Source
Expand description

GitHub Workflow Status (branch)

Minimal, safe and flexible in-memory bookkeeping API

§Features

  • The book balance is guaranteed at compile time.
  • Explicit ordering of transactions
  • Strong support for multiple units (currencies)
  • Use your own number types
  • Arbitrary extra data
  • Introduction documentation

§Non-features

Everything in this list is beyond the scope of this library:

  • Account types (asset/liability/income/expense/etc.)
  • Reports

§Todo

  • Cache balance calculations
  • Serialization

§Introduction

Read the entire introduction.

§A note on panics

“This API can panic in a bunch of places. I don’t like that. I don’t feel safe. How about returning Results, instead?”

Results and errors are for when a function might fail despite all caution. In this crate, panics would only occur on wrong usage. Having this crate return Results would complicate the API and — worse — would give the impression that function calls could fail even when used correctly. I’d like the user to be confident that with correct usage the API is safe.

§Get involved

If you’re using this crate, then please let me know—I’d be so happy!

If you have a question, find an issue and/or would like to contribute, please open an issue on the tracker or send me an email to mightyiampresence@gmail.com.

Modules§

introduction
Table of contents

Structs§

AccountKey
A key type for referencing accounts.
Balance
Represents a balance, yet not necessarily the current balance.
Book
Represents a book.
Move
Represents a move of a Sum from one account to another.
MoveIndex
Used to index moves in a transaction.
Sum
Represents amounts of any number of units.
Transaction
Represents a transaction.
TransactionIndex
Used to index transactions in the book.

Enums§

Side
Represents a side of a Move.