Expand description
§Midasio
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
: Implementrayon
’sIntoParallelIterator
forFileView
. This feature makes parallel analysis of MIDAS events very easy with theFileView::par_iter
andFileView::into_par_iter
methods.
Structs§
- Bank
View - An immutable view to a data bank in a MIDAS file.
- Event
View - An immutable view to an event in a MIDAS file.
- File
View - An immutable view to a MIDAS file.
- Parse
Error - The error type returned when parsing a MIDAS file fails.
Enums§
- Data
Type - Possible data types stored inside a data bank.
Functions§
- initial_
timestamp_ unchecked - Returns the timestamp of the initial ODB dump assuming the correct MIDAS file format.
- run_
number_ unchecked - Returns the run number assuming that the input slice has the correct MIDAS file format.