mzdata_meta/run.rs
1use chrono::{DateTime, FixedOffset};
2
3/// Metadata describing the experiment that does not belong in any other section
4/// that covers some default options.
5#[derive(Debug, Default, PartialEq, Hash, Eq, Clone)]
6#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
7pub struct MassSpectrometryRun {
8 /// A unique identifier for the entire MS run.
9 pub id: Option<String>,
10 /// The default [`DataProcessing`](crate::DataProcessing) identifier to use, if any, for entities that do not
11 /// list their own method.
12 pub default_data_processing_id: Option<String>,
13 /// The default [`InstrumentConfiguration`](crate::InstrumentConfiguration) identifier to use, if any, for entities that do
14 /// not list their own configuration.
15 pub default_instrument_id: Option<u32>,
16 /// The default [`SourceFile`](crate::SourceFile) identifier that entries come from, for entities that do not list their own
17 /// source.
18 pub default_source_file_id: Option<String>,
19 /// The date and time acquisition began.
20 pub start_time: Option<DateTime<FixedOffset>>,
21}
22
23impl MassSpectrometryRun {
24 pub fn new(
25 id: Option<String>,
26 default_data_processing_id: Option<String>,
27 default_instrument_id: Option<u32>,
28 default_source_file_id: Option<String>,
29 start_time: Option<DateTime<FixedOffset>>,
30 ) -> Self {
31 Self {
32 id,
33 default_data_processing_id,
34 default_instrument_id,
35 default_source_file_id,
36 start_time,
37 }
38 }
39}