Skip to main content

Crate card_messages

Crate card_messages 

Source
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§

AdditionalAmount
One 20-character component of DE54.
BinaryPds
Borrowed view over the binary payload form of PDS 0171 or 0178.
CardAcceptorLocation
Components derived from the structured DE43 location field.
DataElement3
Structured DE3 processing code.
DataElement22
Structured DE22 point-of-service data.
DataElement30
Structured DE30 with two twelve-digit amount components.
DataElement31
Structured DE31 reference including its check digit.
DataElement54
Structured DE54 additional amounts.
DataElement55
Structured DE55 with lossless bytes and partial-parse status.
DataElement63
Structured DE63 value.
DataElement105
Structured DE105 data records.
DataElement105Subelement
One tag-length-value subelement from DE105.
DataElementNumber
ISO 8583 data-element number in the supported 2 through 127 range.
FieldSpecTable
Lookup table for supported data elements (typically DE 2 through 127).
InvalidBlockDetail
Diagnostic detail for ParseErrorKind::InvalidBlock.
IpmReader
Iterator over parsed IPM messages from a streaming reader.
LocalDateTime
Calendar date and wall-clock time decoded from DE12.
LogicalFileValidator
Incremental header, trailer, sequencing, total, and addendum validator.
Message
One parsed clearing message with its original wire record.
MessageProfile
One supported MTI/function-code profile and its unconditional requirements.
MessageTypeIndicator
Four-digit ISO 8583 message type indicator.
MessageValidator
Applies profile requirements using the same granular actions as parsing.
ParseError
Failure returned while reading or parsing one record.
ParseErrorDetail
Failure offset, fail-site bytes, and bounded preceding field snapshots.
ParseFieldSnapshot
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.
ReaderOptions
Configuration for IpmReader.
Tlv
One BER-TLV value from DE55.
UnparsedDataElement
Raw fallback used when a typed value is invalid under a non-error policy.
ValidationContext
Bounded wire context for a validation issue when available.
ValidationIssue
One recoverable rule violation.
ValidationPolicy
Per-rule validation actions.

Enums§

Blocking
Physical framing used by the input stream.
DataElementValue
Parsed value of one ISO 8583 data element.
FieldSpecError
Errors while loading a YAML field-specification file.
MessageCategory
Functional family of a supported message profile.
ParseErrorKind
Structured reason for a record parsing failure.
TextEncoding
Text encoding applied to MTIs, length prefixes, and textual fields.
ValidationAction
Result requested when a validation rule is violated.
ValidationRule
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.