openmassspec_core/lib.rs
1//! `openmassspec-core` is the shared foundation for the open Rust mass-spec
2//! parsers (`opentfraw`, `opentimstdf`, `openwraw`, `openaraw`, `opensxraw`,
3//! `openszraw`).
4//!
5//! It exposes:
6//!
7//! * Vendor-neutral spectrum / chromatogram / run records:
8//! [`SpectrumRecord`], [`PrecursorInfo`], [`ChromatogramRecord`],
9//! [`RunMetadata`], [`CvTerm`]. All are `#[non_exhaustive]` and built with
10//! constructors plus `with_*` setters.
11//! * Shared enums: [`Polarity`], [`ScanMode`], [`Analyzer`], [`MsPower`],
12//! [`Activation`], [`Compression`], [`MobilityArrayKind`].
13//! * A trait every vendor parser implements: [`SpectrumSource`]. Its
14//! iterators yield `Result` items, so decode errors reach the consumer.
15//! * One canonical mzML 1.1.0 writer: [`write_mzml`] and
16//! [`write_indexed_mzml`] (zlib-compressed binary data arrays, stop at the
17//! first record error), with [`WriteOptions`] for codec and
18//! [`RecordErrorPolicy`] control. Each call returns a [`WriteSummary`].
19//! * Typed PSI-MS / UO terms generated from `psi-ms.obo`: [`cv`].
20//! * A streaming profile-to-centroid transform, [`Centroided`], that wraps
21//! any `SpectrumSource`.
22//! * A conformance harness for parser test suites: [`conformance`].
23//!
24//! The Apache Arrow bridge lives in the separate `openmassspec-arrow` crate.
25//!
26//! Each vendor crate is a standalone tool (a user can pull in `opentfraw`
27//! alone and get parsing **and** mzML export); `openmassspec-core` is the
28//! shared vocabulary that keeps the parsers in lock-step.
29
30#![warn(missing_docs)]
31
32mod centroid;
33mod enums;
34mod error;
35mod mzml;
36mod source;
37mod types;
38
39pub mod conformance;
40pub mod cv;
41
42pub use centroid::Centroided;
43pub use enums::{
44 Activation, Analyzer, Compression, MobilityArrayKind, MsPower, Polarity, ScanMode,
45};
46pub use error::{Error, Result};
47pub use mzml::{
48 write_indexed_mzml, write_indexed_mzml_with_options, write_mzml, write_mzml_with_options,
49 RecordErrorPolicy, WriteOptions, WriteSummary,
50};
51pub use source::{ChromatogramIter, SpectrumIter, SpectrumSource};
52pub use types::{ChromatogramRecord, CvTerm, PrecursorInfo, RunMetadata, SpectrumRecord};
53
54/// Crate version (set from `Cargo.toml`).
55pub const VERSION: &str = env!("CARGO_PKG_VERSION");