Crates.io | midasio |
lib.rs | midasio |
version | 0.7.0 |
source | src |
created_at | 2022-03-23 08:26:14.970859 |
updated_at | 2024-08-06 18:53:48.905534 |
description | Utilities to read binary files in the MIDAS format |
homepage | |
repository | https://github.com/MIDAS-rs/midasio |
max_upload_size | |
id | 555098 |
size | 79,494 |
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.
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.
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.