11 releases

0.5.4 Feb 15, 2024
0.5.2 Dec 28, 2023
0.4.1 Feb 5, 2023
0.4.0 Jun 20, 2022
0.1.0 Mar 23, 2022

#544 in Parser implementations

Download history 33/week @ 2023-12-07 21/week @ 2023-12-28 1/week @ 2024-01-04 9/week @ 2024-01-11 110/week @ 2024-02-15 46/week @ 2024-02-22 36/week @ 2024-02-29 17/week @ 2024-03-07 14/week @ 2024-03-14

79 downloads per month
Used in 3 crates

MIT license

63KB
1K SLoC

Midasio

Test Status Crates.io

A Rust library for reading binary MIDAS files.

Midasio provides utilities to iterate over the MIDAS events in a file, iterate over the data banks in a MIDAS event, and extract the raw data from the banks.

Quick Start

To get you started quickly, the easiest and highest-level way to read a binary MIDAS file is from a &[u8]. Parsing and iterating over the contents of a file is as simple as:

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let contents = std::fs::read("example.mid")?;
    let file_view = midasio::FileView::try_from(&contents[..])?;

    for event_view in file_view {
        // Do something with each event in the file.
        for bank_view in event_view {
            // Do something with each data bank in the event.
        }
    }

    Ok(())
}

Feature flags

  • rayon: Implement rayon's IntoParallelIterator for FileView. This feature makes parallel analysis of MIDAS events very easy with the FileView::par_iter and FileView::into_par_iter methods.

Dependencies

~1.1–1.8MB
~39K SLoC