Expand description
Streaming parsing for card clearing messages.
The crate reads VBS record streams, optionally removes 1014-byte blocking,
and parses the supported ISO 8583 data elements into explicit Rust types.
IpmReader is the main entry point; Message describes each record.
§Example
use std::io::Cursor;
use card_messages::{Blocking, IpmReader, ReaderOptions, TextEncoding};
let options = ReaderOptions {
blocking: Blocking::None,
encoding: TextEncoding::Latin1,
..ReaderOptions::default()
};
let input = Cursor::new([0_u8; 4]);
let mut records = IpmReader::new(input, options);
assert!(records.next().is_none());Structs§
- Additional
Amount - One 20-character component of DE54.
- Binary
Pds - Borrowed view over the binary payload form of PDS 0171 or 0178.
- Card
Acceptor Location - Components derived from the structured DE43 location field.
- Data
Element3 - Structured DE3 processing code.
- Data
Element22 - Structured DE22 point-of-service data.
- Data
Element30 - Structured DE30 with two twelve-digit amount components.
- Data
Element31 - Structured DE31 reference including its check digit.
- Data
Element54 - Structured DE54 additional amounts.
- Data
Element55 - Structured DE55 with lossless bytes and partial-parse status.
- Data
Element63 - Structured DE63 value.
- Data
Element105 - Structured DE105 data records.
- Data
Element105 Subelement - One tag-length-value subelement from DE105.
- Data
Element Number - ISO 8583 data-element number in the supported 2 through 127 range.
- Field
Spec Table - Lookup table for supported data elements (typically DE 2 through 127).
- Invalid
Block Detail - Diagnostic detail for
ParseErrorKind::InvalidBlock. - IpmReader
- Iterator over parsed IPM messages from a streaming reader.
- Local
Date Time - Calendar date and wall-clock time decoded from DE12.
- Logical
File Validator - Incremental header, trailer, sequencing, total, and addendum validator.
- Message
- One parsed clearing message with its original wire record.
- Message
Profile - One supported MTI/function-code profile and its unconditional requirements.
- Message
Type Indicator - Four-digit ISO 8583 message type indicator.
- Message
Validator - Applies profile requirements using the same granular actions as parsing.
- Parse
Error - Failure returned while reading or parsing one record.
- Parse
Error Detail - Failure offset, fail-site bytes, and bounded preceding field snapshots.
- Parse
Field Snapshot - Bounded snapshot of one successfully parsed data element before a failure.
- Pds
- One ordered PDS occurrence with its original value bytes.
- PdsTag
- PDS tag in the supported 0001 through 9999 range.
- Reader
Options - Configuration for
IpmReader. - Tlv
- One BER-TLV value from DE55.
- Unparsed
Data Element - Raw fallback used when a typed value is invalid under a non-error policy.
- Validation
Context - Bounded wire context for a validation issue when available.
- Validation
Issue - One recoverable rule violation.
- Validation
Policy - Per-rule validation actions.
Enums§
- Blocking
- Physical framing used by the input stream.
- Data
Element Value - Parsed value of one ISO 8583 data element.
- Field
Spec Error - Errors while loading a YAML field-specification file.
- Message
Category - Functional family of a supported message profile.
- Parse
Error Kind - Structured reason for a record parsing failure.
- Text
Encoding - Text encoding applied to MTIs, length prefixes, and textual fields.
- Validation
Action - Result requested when a validation rule is violated.
- Validation
Rule - Individually configurable structural, message-profile, and logical-file rule.
Constants§
- DEFAULT_
FIELD_ SPEC_ YAML - Reference YAML bundled with the crate (matches
FieldSpecTable::builtin). - PARSE_
FAIL_ SITE_ BYTES - Bytes kept from the failure offset in a wire record.
- PARSE_
FIELD_ PREVIEW_ BYTES - Preview bytes stored per successfully parsed data element.
- PARSE_
RECORD_ START_ BYTES - Bytes kept from the start of a failing wire record.
Functions§
- format_
wire_ preview - message_
profiles - Returns every built-in message profile.