use iso8211::DataDescriptiveFile; fn main() { let path = "/home/rene/Source/iso8211/tests/data/S-101-Test-Datasets/S-164/v4/BaseTest/BaseTest/1012C002C3NEWCC/1012C002C3NEWCC/1012C002C3NEWCC.000"; let ddf = DataDescriptiveFile::read(path).unwrap(); println!("\nData Descriptive Record:"); println!(" File Control Field:"); println!(" Tag Pairs:"); for tp in ddf .data_descriptive_record() .file_control_field() .tag_pairs() { println!(" {} -> {}", tp.0, tp.1); } println!(" Data Decriptive Fields:"); for f in ddf.data_descriptive_record().data_descriptive_fields() { println!(" Field Controls:"); println!( " Data Structure: {}", f.field_controls().data_structure() ); println!(" Data Type: {}", f.field_controls().data_type()); println!( " Escape Sequence: {}", f.field_controls().escape_sequence() ); println!(" Field Name: {}", f.field_name()); println!(" Array Descriptor: {}", f.array_descriptor()); println!(" Format Controls:"); for fc in f.format_controls().formats() { println!(" Format: {}", fc); } } for dr in ddf.data_records() { println!("\nData Record:"); for df in dr.data_fields() { println!(" Data Field: {} bytes", df.user_data().len()); } } }