Skip to main content

Module model

Module model 

Source
Expand description

The clean-room COBOL-record data model for kobold-csv.

This is a plain Rust description of a record layout (a tree of named fields with offsets, lengths and PIC kinds) plus the decoded result of applying it to raw bytes. It is independent of GnuCOBOL/libcob – it links no COBOL runtime and reproduces no runtime’s exact behavior. The caller describes their copybook by whatever means they like and feeds raw record bytes to the KOBOLD.CSV.EXPORT.1 court.

This model is a clean-room COPY of the kobold-json model; kobold-csv does NOT depend on kobold-json (or any GnuCOBOL crate) – the two crates are deliberately self-contained so each can ship independently.

Structs§

Copybook
A copybook: the record name, the declared character encoding (informational, carried into the packet), and the top-level fields in order.
DecodedField
A decoded leaf field: its name, the rendered semantic value, the raw bytes, the declaration it came from, and any findings raised while decoding it.
FieldDecl
A single field declaration from a copybook: a name, its PIC string, its byte offset within the record, its byte length, and its FieldKind.
Finding
A finding emitted by a court instead of a silent coercion: a stable code and a human message.

Enums§

FieldKind
The storage kind of a field, as declared by the copybook.