Expand description
§use-bai2
Initial BAI2 banking file primitives for RustUse finance crates.
use-bai2 provides conservative BAI2 record-code parsing, typed record wrappers, continuation handling, basic validation, and normalized transaction detail output. It intentionally preserves raw codes where the BAI2 standard can expand later.
§Example
use use_bai2::{parse_logical_records, NormalizedTransaction, TransactionDetailRecord};
let records = parse_logical_records("16,475,12345,Z,bank-ref,customer-ref,payment/\n")?;
let detail = TransactionDetailRecord::try_from(&records[0])?;
let normalized = NormalizedTransaction::from_detail(&detail)?;
assert_eq!(normalized.amount().minor_units(), 12_345);§Scope
Use this crate for first-pass BAI2 parsing and validation. It does not fully enumerate every BAI2 type code, connect to banks, fetch statements, process ACH or wires, or perform reconciliation.
§License
Licensed under either MIT or Apache-2.0.
Modules§
- prelude
- Common BAI2 primitives.
Structs§
- Account
Identifier Record - BAI2 account identifier record.
- Account
Trailer Record - BAI2 account trailer record.
- Continuation
Record - BAI2 continuation record.
- File
Header Record - BAI2 file header record.
- File
Trailer Record - BAI2 file trailer record.
- Funds
Type Code - A raw BAI2 funds type code.
- Group
Header Record - BAI2 group header record.
- Group
Trailer Record - BAI2 group trailer record.
- Normalized
Transaction - A normalized transaction detail value.
- RawRecord
- A parsed BAI2 record with raw fields preserved.
- Transaction
Detail Record - BAI2 transaction detail record.
- Transaction
Type Code - A raw BAI2 transaction type code.
Enums§
- Bai2
Error - Errors returned by BAI2 parsing and validation.
- Record
Code - Supported BAI2 record codes.
Functions§
- parse_
line - Parses a single slash-terminated BAI2 line.
- parse_
logical_ records - Parses BAI2 lines and folds
88continuation records into the previous logical record.