12 unstable releases (5 breaking)

new 0.6.0 May 3, 2024
0.5.4 Feb 15, 2024
0.5.3 Jan 3, 2024
0.5.2 Dec 28, 2023
0.1.0 Mar 23, 2022

#557 in Parser implementations

Download history 5/week @ 2024-01-06 4/week @ 2024-01-13 88/week @ 2024-02-10 32/week @ 2024-02-17 67/week @ 2024-02-24 5/week @ 2024-03-02 27/week @ 2024-03-09 4/week @ 2024-03-16 43/week @ 2024-03-30 9/week @ 2024-04-06

52 downloads per month
Used in 3 crates

MIT license

67KB
1.5K 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_bytes(&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(())
}

More examples with common use cases can be found here.

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

~0.8–1MB
~21K SLoC