igc_parser 0.1.7

A high-level parsing/deserializing crate for IGC flight recorder files
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
use std::marker::PhantomData;

use crate::error::IGCError::IGCFileInitError;
use crate::records::comment::Comment;
use crate::records::data_fix::DataFix;
use crate::records::diff_gps::DiffGPS;
use crate::records::event::Event;
use crate::records::extension::Extension;
use crate::records::file_header::FileHeader;
use crate::records::fix::Fix;
use crate::records::flight_recorder_id::FlightRecorderID;
use crate::records::satellite::Satellite;
use crate::records::security::Security;
use crate::records::task_info::TaskInfo;
use crate::records::Record;
use crate::Result;

/*
To the reader of this file
The const bool generics give a nice effect without ever having to return options
It unfortunately does not look very nice and requires a lot of generic copying code
*/


pub struct Parsed<
const A: bool,
const B: bool,
const C: bool,
const D: bool,
const E: bool,
const F: bool,
const G: bool,
const H: bool,
const I: bool,
const J: bool,
const K: bool,
const L: bool,
> {
    fr_ids: Option<Vec<Result<FlightRecorderID>>>,
    fixes: Option<Vec<Result<Fix>>>,
    task_info: Option<Vec<Result<TaskInfo>>>,
    differential_gps_records: Option<Vec<Result<DiffGPS>>>,
    events: Option<Vec<Result<Event>>>,
    satellite_vec: Option<Vec<Result<Satellite>>>,
    security_vec: Option<Vec<Result<Security>>>,
    file_header_vec: Option<Vec<Result<FileHeader>>>,
    i_extension_vec: Option<Vec<Result<Extension>>>,
    j_extension_vec: Option<Vec<Result<Extension>>>,
    data_fix_vec: Option<Vec<Result<DataFix>>>,
    comment_vec: Option<Vec<Result<Comment>>>,
}

impl<
const B: bool,
const C: bool,
const D: bool,
const E: bool,
const F: bool,
const G: bool,
const H: bool,
const I: bool,
const J: bool,
const K: bool,
const L: bool,
> Parsed<true,B,C,D,E,F,G,H,I,J,K,L> {
    /// Get flight records ID's from the parsed file
    /// Identical to `get_a_records`
    pub fn get_fr_ids(&self) -> &Vec<Result<FlightRecorderID>> {
        self.fr_ids.as_ref().expect("uncreachable typestate error")
    }

    /// Get flight records ID's from the parsed file
    /// Identical to `get_fr_ids`
    pub fn get_a_records(&self) -> &Vec<Result<FlightRecorderID>> {
        self.get_fr_ids()
    }
}

impl<
const A: bool,
const C: bool,
const D: bool,
const E: bool,
const F: bool,
const G: bool,
const H: bool,
const I: bool,
const J: bool,
const K: bool,
const L: bool,
> Parsed<A,true,C,D,E,F,G,H,I,J,K,L> {
    /// Get fixes from the parsed file
    /// Identical to `get_b_records`
    pub fn get_fixes(&self) -> &Vec<Result<Fix>> {
        self.fixes.as_ref().expect("uncreachable typestate error")
    }

    /// Get flight records ID's from the parsed file
    /// Identical to `get_fixes`
    pub fn get_b_records(&self) -> &Vec<Result<Fix>> {
        self.get_fixes()
    }
}

impl<
const A: bool,
const B: bool,
const D: bool,
const E: bool,
const F: bool,
const G: bool,
const H: bool,
const I: bool,
const J: bool,
const K: bool,
const L: bool,
> Parsed<A,B,true,D,E,F,G,H,I,J,K,L> {
    /// Get task info from the parsed file
    /// Identical to `get_c_records`
    pub fn get_task_info(&self) -> &Vec<Result<TaskInfo>> {
        self.task_info.as_ref().expect("uncreachable typestate error")
    }

    /// Get task info from the parsed file
    /// Identical to `get_task_info`
    pub fn get_c_records(&self) -> &Vec<Result<TaskInfo>> {
        self.get_task_info()
    }
}

impl<
const A: bool,
const B: bool,
const C: bool,
const E: bool,
const F: bool,
const G: bool,
const H: bool,
const I: bool,
const J: bool,
const K: bool,
const L: bool,
> Parsed<A,B,C,true,E,F,G,H,I,J,K,L> {
    /// Get differential GPS records from the parsed file
    /// Identical to `get_d_records`
    pub fn get_differential_gps_records(&self) -> &Vec<Result<DiffGPS>> {
        self.differential_gps_records.as_ref().expect("uncreachable typestate error")
    }

    /// Get differential GPS records from the parsed file
    /// Identical to `get_differential_gps_records`
    pub fn get_d_records(&self) -> &Vec<Result<DiffGPS>> {
        self.get_differential_gps_records()
    }
}

impl<
const A: bool,
const B: bool,
const C: bool,
const D: bool,
const F: bool,
const G: bool,
const H: bool,
const I: bool,
const J: bool,
const K: bool,
const L: bool,
> Parsed<A,B,C,D,true,F,G,H,I,J,K,L> {
    /// Get events from the parsed file
    /// Identical to `get_e_records`
    pub fn get_events(&self) -> &Vec<Result<Event>> {
        self.events.as_ref().expect("uncreachable typestate error")
    }

    /// Get events from the parsed file
    /// Identical to `get_events`
    pub fn get_e_records(&self) -> &Vec<Result<Event>> {
        self.get_events()
    }
}

impl<
const A: bool,
const B: bool,
const C: bool,
const D: bool,
const E: bool,
const G: bool,
const H: bool,
const I: bool,
const J: bool,
const K: bool,
const L: bool,
> Parsed<A,B,C,D,E,true,G,H,I,J,K,L> {
    /// Get satellite data from the parsed file
    /// Identical to `get_f_records`
    pub fn get_satellite_vec(&self) -> &Vec<Result<Satellite>> {
        self.satellite_vec.as_ref().expect("uncreachable typestate error")
    }

    /// Get satellite data from the parsed file
    /// Identical to `get_satellite_vec`
    pub fn get_f_records(&self) -> &Vec<Result<Satellite>> {
        self.get_satellite_vec()
    }
}

impl<
const A: bool,
const B: bool,
const C: bool,
const D: bool,
const E: bool,
const F: bool,
const H: bool,
const I: bool,
const J: bool,
const K: bool,
const L: bool,
> Parsed<A,B,C,D,E,F,true,H,I,J,K,L> {
    /// Get security data from the parsed file
    /// Identical to `get_g_records`
    pub fn get_security_vec(&self) -> &Vec<Result<Security>> {
        self.security_vec.as_ref().expect("uncreachable typestate error")
    }

    /// Get security data from the parsed file
    /// Identical to `get_security_vec`
    pub fn get_g_records(&self) -> &Vec<Result<Security>> {
        self.get_security_vec()
    }
}

impl<
const A: bool,
const B: bool,
const C: bool,
const D: bool,
const E: bool,
const F: bool,
const G: bool,
const I: bool,
const J: bool,
const K: bool,
const L: bool,
> Parsed<A,B,C,D,E,F,G,true,I,J,K,L> {
    /// Get file headers from the parsed file
    /// Identical to `get_h_records`
    pub fn get_file_header_vec(&self) -> &Vec<Result<FileHeader>> {
        self.file_header_vec.as_ref().expect("uncreachable typestate error")
    }

    /// Get file headers from the parsed file
    /// Identical to `get_file_header_vec`
    pub fn get_h_records(&self) -> &Vec<Result<FileHeader>> {
        self.get_file_header_vec()
    }
}

impl<
const A: bool,
const B: bool,
const C: bool,
const D: bool,
const E: bool,
const F: bool,
const G: bool,
const H: bool,
const J: bool,
const K: bool,
const L: bool,
> Parsed<A,B,C,D,E,F,G,H,true,J,K,L> {
    /// Get fix extensions from the parsed file
    /// Identical to `get_i_records`
    pub fn get_fix_extension_vec(&self) -> &Vec<Result<Extension>> {
        self.i_extension_vec.as_ref().expect("uncreachable typestate error")
    }

    /// Get fix extensions from the parsed file
    /// Identical to `get_fix_extension_vec`
    pub fn get_i_records(&self) -> &Vec<Result<Extension>> {
        self.get_fix_extension_vec()
    }
}

impl<
const A: bool,
const B: bool,
const C: bool,
const D: bool,
const E: bool,
const F: bool,
const G: bool,
const H: bool,
const I: bool,
const K: bool,
const L: bool,
> Parsed<A,B,C,D,E,F,G,H,I,true,K,L> {
    /// Get data fix extensions from the parsed file
    /// Identical to `get_j_records`
    pub fn get_data_fix_extension_vec(&self) -> &Vec<Result<Extension>> {
        self.j_extension_vec.as_ref().expect("uncreachable typestate error")
    }

    /// Get data fix extensions from the parsed file
    /// Identical to `get_data_fix_extension_vec`
    pub fn get_j_records(&self) -> &Vec<Result<Extension>> {
        self.get_data_fix_extension_vec()
    }
}

impl<
const A: bool,
const B: bool,
const C: bool,
const D: bool,
const E: bool,
const F: bool,
const G: bool,
const H: bool,
const I: bool,
const J: bool,
const L: bool,
> Parsed<A,B,C,D,E,F,G,H,I,J,true,L> {
    /// Get data fixes from the parsed file
    /// Identical to `get_k_records`
    pub fn get_data_fix_vec(&self) -> &Vec<Result<DataFix>> {
        self.data_fix_vec.as_ref().expect("uncreachable typestate error")
    }

    /// Get data fixes from the parsed file
    /// Identical to `get_data_fix_vec`
    pub fn get_k_records(&self) -> &Vec<Result<DataFix>> {
        self.get_data_fix_vec()
    }
}

impl<
const A: bool,
const B: bool,
const C: bool,
const D: bool,
const E: bool,
const F: bool,
const G: bool,
const H: bool,
const I: bool,
const J: bool,
const K: bool,
> Parsed<A,B,C,D,E,F,G,H,I,J,K,true> {
    /// Get comments from the parsed file
    /// Identical to `get_l_records`
    pub fn get_comment_vec(&self) -> &Vec<Result<Comment>> {
        self.comment_vec.as_ref().expect("uncreachable typestate error")
    }

    /// Get comments from the parsed file
    /// Identical to `get_comment_vec`
    pub fn get_l_records(&self) -> &Vec<Result<Comment>> {
        self.get_comment_vec()
    }
}

#[derive(Clone, Debug)]
pub struct ParserBuilder<
    const A: bool,
    const B: bool,
    const C: bool,
    const D: bool,
    const E: bool,
    const F: bool,
    const G: bool,
    const H: bool,
    const I: bool,
    const J: bool,
    const K: bool,
    const L: bool,
> {}

pub fn new_builder(
) -> ParserBuilder<false, false, false, false, false, false, false, false, false, false, false, false>
{
    ParserBuilder {}
}

impl<
        const A: bool,
        const B: bool,
        const C: bool,
        const D: bool,
        const E: bool,
        const F: bool,
        const G: bool,
        const H: bool,
        const I: bool,
        const J: bool,
        const K: bool,
        const L: bool,
    > ParserBuilder<A,B,C,D,E,F,G,H,I,J,K,L>
{
    pub fn on_file(self, content: &str) -> Result<Parsed<A,B,C,D,E,F,G,H,I,J,K,L>> {
        let mut fr_ids: Option<Vec<Result<FlightRecorderID>>> = match A {
            true => Some(Vec::new()),
            false => None,
        };
        let mut fixes: Option<Vec<Result<Fix>>> = match B {
            true => Some(Vec::new()),
            false => None,
        };
        let mut task_info: Option<Vec<Result<TaskInfo>>> = match C {
            true => Some(Vec::new()),
            false => None,
        };
        let mut differential_gps_records: Option<Vec<Result<DiffGPS>>> = match D {
                true => Some(Vec::new()),
                false => None,
            };
        let mut events: Option<Vec<Result<Event>>> = match E {
            true => Some(Vec::new()),
            false => None,
        };
        let mut satellite_vec: Option<Vec<Result<Satellite>>> = match F {
            true => Some(Vec::new()),
            false => None,
        };
        let mut security_vec: Option<Vec<Result<Security>>> = match G {
            true => Some(Vec::new()),
            false => None,
        };
        let mut file_header_vec: Option<Vec<Result<FileHeader>>> = match H {
            true => Some(Vec::new()),
            false => None,
        };
        let mut i_extension_vec: Option<Vec<Result<Extension>>> = match I {
            true => Some(Vec::new()),
            false => None,
        };
        let mut j_extension_vec: Option<Vec<Result<Extension>>> = match J {
            true => Some(Vec::new()),
            false => None,
        };
        let mut data_fix_vec: Option<Vec<Result<DataFix>>> = match K {
            true => Some(Vec::new()),
            false => None,
        };
        let mut comment_vec: Option<Vec<Result<Comment>>> = match L {
            true => Some(Vec::new()),
            false => None,
        };
        for line in content.lines() {
            let record = Record::parse(line);
            match line.chars().next() {
                Some(letter) => match letter {
                    'A' => {
                        if let Some(fr_ids) = &mut fr_ids {
                            fr_ids.push(match record {
                                Ok(Record::A(frid)) => Ok(frid),
                                Err(error) => Err(error),
                                _ => unreachable!(),
                            })
                        }
                    }
                    'B' => {
                        if let Some(fixes) = &mut fixes {
                            fixes.push(match record {
                                Ok(Record::B(fix)) => Ok(fix),
                                Err(error) => Err(error),
                                _ => unreachable!(),
                            })
                        }
                    }
                    'C' => {
                        if let Some(task_info) = &mut task_info {
                            task_info.push(match record {
                                Ok(Record::C(info)) => Ok(info),
                                Err(error) => Err(error),
                                _ => unreachable!(),
                            })
                        }
                    }
                    'D' => {
                        if let Some(differential_gps_records) = &mut differential_gps_records {
                            differential_gps_records.push(match record {
                                Ok(Record::D(diff_gps)) => Ok(diff_gps),
                                Err(error) => Err(error),
                                _ => unreachable!(),
                            })
                        }
                    }
                    'E' => {
                        if let Some(events) = &mut events {
                            events.push(match record {
                                Ok(Record::E(event)) => Ok(event),
                                Err(error) => Err(error),
                                _ => unreachable!(),
                            })
                        }
                    }
                    'F' => {
                        if let Some(satellite_vec) = &mut satellite_vec {
                            satellite_vec.push(match record {
                                Ok(Record::F(sat)) => Ok(sat),
                                Err(error) => Err(error),
                                _ => unreachable!(),
                            })
                        }
                    }
                    'G' => {
                        if let Some(security_vec) = &mut security_vec {
                            security_vec.push(match record {
                                Ok(Record::G(sec)) => Ok(sec),
                                Err(error) => Err(error),
                                _ => unreachable!(),
                            })
                        }
                    }
                    'H' => {
                        if let Some(file_header_vec) = &mut file_header_vec {
                            file_header_vec.push(match record {
                                Ok(Record::H(header)) => Ok(header),
                                Err(error) => Err(error),
                                _ => unreachable!(),
                            })
                        }
                    }
                    'I' => {
                        if let Some(i_extension_vec) = &mut i_extension_vec {
                            i_extension_vec.push(match record {
                                Ok(Record::I(ext)) => Ok(ext),
                                Err(error) => Err(error),
                                _ => unreachable!(),
                            })
                        }
                    }
                    'J' => {
                        if let Some(j_extension_vec) = &mut j_extension_vec {
                            j_extension_vec.push(match record {
                                Ok(Record::J(ext)) => Ok(ext),
                                Err(error) => Err(error),
                                _ => unreachable!(),
                            })
                        }
                    }
                    'K' => {
                        if let Some(data_fix_vec) = &mut data_fix_vec {
                            data_fix_vec.push(match record {
                                Ok(Record::K(data_fix)) => Ok(data_fix),
                                Err(error) => Err(error),
                                _ => unreachable!(),
                            })
                        }
                    }
                    'L' => {
                        if let Some(comment_vec) = &mut comment_vec {
                            comment_vec.push(match record {
                                Ok(Record::L(comment)) => Ok(comment),
                                Err(error) => Err(error),
                                _ => unreachable!(),
                            })
                        }
                    }
                    _ => {
                        return Err(IGCFileInitError(format!(
                            "{line} does not have a valid start letter"
                        )))
                    }
                },
                None => {
                    return Err(IGCFileInitError(format!(
                        "{line} does not have a valid start letter"
                    )))
                }
            }
        }
        Ok(Parsed {
            fr_ids,
            fixes,
            task_info,
            differential_gps_records,
            events,
            satellite_vec,
            security_vec,
            file_header_vec,
            i_extension_vec,
            j_extension_vec,
            data_fix_vec,
            comment_vec,
        })
    }
}
// Implementation for enabling parsing of flight record IDs when A is false.
impl<
    const B: bool,
    const C: bool,
    const D: bool,
    const E: bool,
    const F: bool,
    const G: bool,
    const H: bool,
    const I: bool,
    const J: bool,
    const K: bool,
    const L: bool,
> ParserBuilder<false, B, C, D, E, F, G, H, I, J, K, L>
{
    /// Enable builder to parse flight recorder ID's
    /// Identical to `parse_a_records`
    pub fn parse_flight_record_id(self) -> ParserBuilder<true, B, C, D, E, F, G, H, I, J, K, L> {
        ParserBuilder {}
    }

    /// Enable builder to parse flight recorder ID's
    /// Identical to `parse_flight_record_id`
    pub fn parse_a_records(self) -> ParserBuilder<true, B, C, D, E, F, G, H, I, J, K, L> {
        ParserBuilder {}
    }
}

// Implementation for enabling parsing of fixes when B is false.
impl<
    const A: bool,
    const C: bool,
    const D: bool,
    const E: bool,
    const F: bool,
    const G: bool,
    const H: bool,
    const I: bool,
    const J: bool,
    const K: bool,
    const L: bool,
> ParserBuilder<A, false, C, D, E, F, G, H, I, J, K, L>
{
    /// Enable builder to parse fixes
    /// Identical to `parse_b_records`
    pub fn parse_fixes(self) -> ParserBuilder<A, true, C, D, E, F, G, H, I, J, K, L> {
        ParserBuilder {}
    }

    /// Enable builder to parse fixes
    /// Identical to `parse_fixes`
    pub fn parse_b_records(self) -> ParserBuilder<A, true, C, D, E, F, G, H, I, J, K, L> {
        ParserBuilder {}
    }
}

// Implementation for enabling parsing of task info when C is false.
impl<
    const A: bool,
    const B: bool,
    const D: bool,
    const E: bool,
    const F: bool,
    const G: bool,
    const H: bool,
    const I: bool,
    const J: bool,
    const K: bool,
    const L: bool,
> ParserBuilder<A, B, false, D, E, F, G, H, I, J, K, L>
{
    /// Enable builder to parse task info
    /// Identical to `parse_c_records`
    pub fn parse_task_info(self) -> ParserBuilder<A, B, true, D, E, F, G, H, I, J, K, L> {
        ParserBuilder {}
    }

    /// Enable builder to parse task info
    /// Identical to `parse_task_info`
    pub fn parse_c_records(self) -> ParserBuilder<A, B, true, D, E, F, G, H, I, J, K, L> {
        ParserBuilder {}
    }
}

// Implementation for enabling parsing of differential GPS records when D is false.
impl<
    const A: bool,
    const B: bool,
    const C: bool,
    const E: bool,
    const F: bool,
    const G: bool,
    const H: bool,
    const I: bool,
    const J: bool,
    const K: bool,
    const L: bool,
> ParserBuilder<A, B, C, false, E, F, G, H, I, J, K, L>
{
    /// Enable builder to parse differential GPS records
    /// Identical to `parse_d_records`
    pub fn parse_differential_gps_records(self) -> ParserBuilder<A, B, C, true, E, F, G, H, I, J, K, L> {
        ParserBuilder {}
    }

    /// Enable builder to parse differential GPS records
    /// Identical to `parse_differential_gps_records`
    pub fn parse_d_records(self) -> ParserBuilder<A, B, C, true, E, F, G, H, I, J, K, L> {
        ParserBuilder {}
    }
}

// Implementation for enabling parsing of events when E is false.
impl<
    const A: bool,
    const B: bool,
    const C: bool,
    const D: bool,
    const F: bool,
    const G: bool,
    const H: bool,
    const I: bool,
    const J: bool,
    const K: bool,
    const L: bool,
> ParserBuilder<A, B, C, D, false, F, G, H, I, J, K, L>
{
    /// Enable builder to parse events
    /// Identical to `parse_e_records`
    pub fn parse_events(self) -> ParserBuilder<A, B, C, D, true, F, G, H, I, J, K, L> {
        ParserBuilder {}
    }

    /// Enable builder to parse events
    /// Identical to `parse_events`
    pub fn parse_e_records(self) -> ParserBuilder<A, B, C, D, true, F, G, H, I, J, K, L> {
        ParserBuilder {}
    }
}

// Implementation for enabling parsing of satellite data when F is false.
impl<
    const A: bool,
    const B: bool,
    const C: bool,
    const D: bool,
    const E: bool,
    const G: bool,
    const H: bool,
    const I: bool,
    const J: bool,
    const K: bool,
    const L: bool,
> ParserBuilder<A, B, C, D, E, false, G, H, I, J, K, L>
{
    /// Enable builder to parse satellite data
    /// Identical to `parse_f_records`
    pub fn parse_satellite(self) -> ParserBuilder<A, B, C, D, E, true, G, H, I, J, K, L> {
        ParserBuilder {}
    }

    /// Enable builder to parse satellite data
    /// Identical to `parse_satellite`
    pub fn parse_f_records(self) -> ParserBuilder<A, B, C, D, E, true, G, H, I, J, K, L> {
        ParserBuilder {}
    }
}

// Implementation for enabling parsing of security data when G is false.
impl<
    const A: bool,
    const B: bool,
    const C: bool,
    const D: bool,
    const E: bool,
    const F: bool,
    const H: bool,
    const I: bool,
    const J: bool,
    const K: bool,
    const L: bool,
> ParserBuilder<A, B, C, D, E, F, false, H, I, J, K, L>
{
    /// Enable builder to parse security data
    /// Identical to `parse_g_records`
    pub fn parse_security(self) -> ParserBuilder<A, B, C, D, E, F, true, H, I, J, K, L> {
        ParserBuilder {}
    }

    /// Enable builder to parse security data
    /// Identical to `parse_security`
    pub fn parse_g_records(self) -> ParserBuilder<A, B, C, D, E, F, true, H, I, J, K, L> {
        ParserBuilder {}
    }
}

// Implementation for enabling parsing of file headers when H is false.
impl<
    const A: bool,
    const B: bool,
    const C: bool,
    const D: bool,
    const E: bool,
    const F: bool,
    const G: bool,
    const I: bool,
    const J: bool,
    const K: bool,
    const L: bool,
> ParserBuilder<A, B, C, D, E, F, G, false, I, J, K, L>
{
    /// Enable builder to parse file headers
    /// Identical to `parse_h_records`
    pub fn parse_file_header(self) -> ParserBuilder<A, B, C, D, E, F, G, true, I, J, K, L> {
        ParserBuilder {}
    }

    /// Enable builder to parse file headers
    /// Identical to `parse_file_header`
    pub fn parse_h_records(self) -> ParserBuilder<A, B, C, D, E, F, G, true, I, J, K, L> {
        ParserBuilder {}
    }
}

// Implementation for enabling parsing of fix extensions when I is false.
impl<
    const A: bool,
    const B: bool,
    const C: bool,
    const D: bool,
    const E: bool,
    const F: bool,
    const G: bool,
    const H: bool,
    const J: bool,
    const K: bool,
    const L: bool,
> ParserBuilder<A, B, C, D, E, F, G, H, false, J, K, L>
{
    /// Enable builder to parse fix extensions
    /// Identical to `parse_i_records`
    pub fn parse_fix_extension(self) -> ParserBuilder<A, B, C, D, E, F, G, H, true, J, K, L> {
        ParserBuilder {}
    }

    /// Enable builder to parse fix extensions
    /// Identical to `parse_fix_extension`
    pub fn parse_i_records(self) -> ParserBuilder<A, B, C, D, E, F, G, H, true, J, K, L> {
        ParserBuilder {}
    }
}

// Implementation for enabling parsing of data fix extensions when J is false.
impl<
    const A: bool,
    const B: bool,
    const C: bool,
    const D: bool,
    const E: bool,
    const F: bool,
    const G: bool,
    const H: bool,
    const I: bool,
    const K: bool,
    const L: bool,
> ParserBuilder<A, B, C, D, E, F, G, H, I, false, K, L>
{
    /// Enable builder to parse data fix extensions
    /// Identical to `parse_j_records`
    pub fn parse_data_fix_extension(self) -> ParserBuilder<A, B, C, D, E, F, G, H, I, true, K, L> {
        ParserBuilder {}
    }

    /// Enable builder to parse data fix extensions
    /// Identical to `parse_data_fix_extension`
    pub fn parse_j_records(self) -> ParserBuilder<A, B, C, D, E, F, G, H, I, true, K, L> {
        ParserBuilder {}
    }
}

// Implementation for enabling parsing of data fixes when K is false.
impl<
    const A: bool,
    const B: bool,
    const C: bool,
    const D: bool,
    const E: bool,
    const F: bool,
    const G: bool,
    const H: bool,
    const I: bool,
    const J: bool,
    const L: bool,
> ParserBuilder<A, B, C, D, E, F, G, H, I, J, false, L>
{
    /// Enable builder to parse data fixes
    /// Identical to `parse_k_records`
    pub fn parse_data_fix(self) -> ParserBuilder<A, B, C, D, E, F, G, H, I, J, true, L> {
        ParserBuilder {}
    }

    /// Enable builder to parse data fixes
    /// Identical to `parse_data_fix`
    pub fn parse_k_records(self) -> ParserBuilder<A, B, C, D, E, F, G, H, I, J, true, L> {
        ParserBuilder {}
    }
}

impl<
    const A: bool,
    const B: bool,
    const C: bool,
    const D: bool,
    const E: bool,
    const F: bool,
    const G: bool,
    const H: bool,
    const I: bool,
    const J: bool,
    const K: bool,
> ParserBuilder<A, B, C, D, E, F, G, H, I, J, K, false>
{
    /// Enable builder to parse comments
    /// Identical to `parse_l_records`
    pub fn parse_comments(self) -> ParserBuilder<A, B, C, D, E, F, G, H, I, J, K, true> {
        ParserBuilder {}
    }

    /// Enable builder to parse comments
    /// Identical to `parse_comments`
    pub fn parse_l_records(self) -> ParserBuilder<A, B, C, D, E, F, G, H, I, J, K, true> {
        ParserBuilder {}
    }
}