Trait mzdata::io::SpectrumGrouping
source · pub trait SpectrumGrouping<C: CentroidLike + Default = CentroidPeak, D: DeconvolutedCentroidLike + Default = DeconvolutedPeak, S: SpectrumLike<C, D> = MultiLayerSpectrum<C, D>>: Default {
// Required methods
fn precursor(&self) -> Option<&S>;
fn precursor_mut(&mut self) -> Option<&mut S>;
fn set_precursor(&mut self, prec: S);
fn products(&self) -> &[S];
fn products_mut(&mut self) -> &mut Vec<S>;
fn into_parts(self) -> (Option<S>, Vec<S>);
// Provided methods
fn total_spectra(&self) -> usize { ... }
fn earliest_spectrum(&self) -> Option<&S> { ... }
fn latest_spectrum(&self) -> Option<&S> { ... }
fn lowest_ms_level(&self) -> Option<u8> { ... }
fn highest_ms_level(&self) -> Option<u8> { ... }
}
Expand description
An abstraction over SpectrumGroup
’s interface.
Required Methods§
sourcefn precursor_mut(&mut self) -> Option<&mut S>
fn precursor_mut(&mut self) -> Option<&mut S>
Get a mutable reference to the precursor spectrum, which may be absent
sourcefn set_precursor(&mut self, prec: S)
fn set_precursor(&mut self, prec: S)
Explicitly set the precursor spectrum directly.
sourcefn products_mut(&mut self) -> &mut Vec<S>
fn products_mut(&mut self) -> &mut Vec<S>
Get a mutable reference to the collection of product spectra
sourcefn into_parts(self) -> (Option<S>, Vec<S>)
fn into_parts(self) -> (Option<S>, Vec<S>)
Decompose the group into its components, discarding any additional metrics
Provided Methods§
sourcefn total_spectra(&self) -> usize
fn total_spectra(&self) -> usize
The total number of spectra in the group
sourcefn earliest_spectrum(&self) -> Option<&S>
fn earliest_spectrum(&self) -> Option<&S>
The spectrum that occurred first chronologically
sourcefn latest_spectrum(&self) -> Option<&S>
fn latest_spectrum(&self) -> Option<&S>
The spectrum that occurred last chronologically
sourcefn lowest_ms_level(&self) -> Option<u8>
fn lowest_ms_level(&self) -> Option<u8>
The lowest MS level in the group
sourcefn highest_ms_level(&self) -> Option<u8>
fn highest_ms_level(&self) -> Option<u8>
The highest MS level in the group
Object Safety§
This trait is not object safe.