Skip to main content

Module reader

Module reader 

Source
Expand description

Reading MARC records from binary streams.

This module provides MarcReader for reading ISO 2709 formatted MARC records from any source that implements std::io::Read.

§Examples

Reading records from a file:

use mrrc::MarcReader;
use std::fs::File;

let file = File::open("records.mrc")?;
let mut reader = MarcReader::new(file);

while let Some(record) = reader.read_record()? {
    println!("Record type: {}", record.leader.record_type);
}

Reading from a buffer:

use mrrc::MarcReader;
use std::io::Cursor;

let data = b"...binary MARC data...";
let cursor = Cursor::new(data.to_vec());
let mut reader = MarcReader::new(cursor);

Structs§

MarcReader
Reader for ISO 2709 binary MARC format.