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
//! # MRRC: MARC Rust Crate
//!
//! A high-performance Rust library for reading, writing, and manipulating MARC bibliographic
//! records in the ISO 2709 binary format.
//!
//! ## Quick Start
//!
//! ### Reading MARC Records
//!
//! ```ignore
//! use mrrc::MarcReader;
//! use std::fs::File;
//!
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let file = File::open("records.mrc")?;
//! let mut reader = MarcReader::new(file);
//!
//! while let Some(record) = reader.read_record()? {
//! if let Some(title) = record.title() {
//! println!("Title: {}", title);
//! }
//! }
//! # Ok(())
//! # }
//! ```
//!
//! ### Creating and Writing MARC Records
//!
//! ```ignore
//! use mrrc::{MarcWriter, Record, Field, Leader};
//!
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let mut record = Record::new(Leader::default());
//! record.add_control_field("001".to_string(), "12345".to_string());
//!
//! let mut field = Field::new("245".to_string(), '1', '0');
//! field.add_subfield('a', "Test Title".to_string());
//! record.add_field(field);
//!
//! let mut buffer = Vec::new();
//! {
//! let mut writer = MarcWriter::new(&mut buffer);
//! writer.write_record(&record)?;
//! }
//! # Ok(())
//! # }
//! ```
//!
//! ### Using Helper Methods
//!
//! ```ignore
//! use mrrc::{Record, Leader, Field};
//!
//! let mut record = Record::new(Leader::default());
//!
//! let mut field_245 = Field::new("245".to_string(), '1', '0');
//! field_245.add_subfield('a', "The Great Gatsby".to_string());
//! field_245.add_subfield('c', "F. Scott Fitzgerald".to_string());
//! record.add_field(field_245);
//!
//! // Use convenience methods
//! assert_eq!(record.title(), Some("The Great Gatsby"));
//! assert_eq!(record.is_book(), true);
//! ```
//!
//! ## Modules
//!
//! - [`record`] — Core MARC record structures (`Record`, `Field`, `Subfield`)
//! - [`reader`] — Reading MARC records from binary data streams
//! - [`writer`] — Writing MARC records to binary format
//! - [`formats`] — Format traits and ISO 2709 support
//! - [`bibframe`] — BIBFRAME linked data conversion
//! - [`boundary_scanner`] — Record boundary detection for parallel processing
//! - [`leader`] — MARC record leader (24-byte header)
//! - [`json`] — JSON serialization/deserialization
//! - [`marcjson`] — MARCJSON format (standard JSON-LD format for MARC)
//! - [`marcxml`] — MARCXML serialization/deserialization
//! - [`csv`] — CSV (Comma-Separated Values) export format
//! - [`dublin_core`] — Dublin Core metadata serialization
//! - [`mods`] — MODS (Metadata Object Description Schema) bidirectional conversion
//! - [`encoding`] — Character encoding support (MARC-8 and UTF-8)
//! - [`error`] — Error types and result type
//!
//! ## Format Support
//!
//! - **ISO 2709 Binary Format** — The standard MARC interchange format
//! - **BIBFRAME** — LOC linked data format for bibliographic description
//! - **JSON** — Generic JSON representation of records
//! - **MARCJSON** — Standard JSON-LD format for MARC records
//! - **MARCXML** — Standard LOC MARCXML with proper attributes and namespace
//! - **CSV** — Tabular export format for spreadsheet applications
//! - **Dublin Core** — Simplified metadata schema for discovery
//! - **MODS** — Detailed metadata description schema for libraries
//! - **Character Encodings** — MARC-8 and UTF-8 with automatic detection
/// Multi-format support with unified Reader/Writer traits.
///
/// See the [`formats`] module documentation for details on supported formats
/// and how to use format-agnostic code.
/// Core MARC record structures (`Record`, `Field`, `Subfield`)
pub use AuthorityQueries;
pub use AuthorityMarcReader;
pub use ;
pub use AuthorityMarcWriter;
pub use ;
pub use ;
pub use ;
pub use LinkageInfo;
pub use ;
pub use FieldQueryHelpers;
pub use ;
pub use HoldingsMarcReader;
pub use ;
pub use HoldingsMarcWriter;
pub use Leader;
pub use MarcRecord;
pub use ;
pub use MarcReader;
pub use ;
pub use GenericRecordBuilder;
pub use RecordHelpers;
pub use RecordStructureValidator;
pub use ;
pub use IndicatorValidator;
pub use MarcWriter;