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§

source

fn precursor(&self) -> Option<&S>

Get the precursor spectrum, which may be absent

source

fn precursor_mut(&mut self) -> Option<&mut S>

Get a mutable reference to the precursor spectrum, which may be absent

source

fn set_precursor(&mut self, prec: S)

Explicitly set the precursor spectrum directly.

source

fn products(&self) -> &[S]

Get a reference to the collection of product spectra

source

fn products_mut(&mut self) -> &mut Vec<S>

Get a mutable reference to the collection of product spectra

source

fn into_parts(self) -> (Option<S>, Vec<S>)

Decompose the group into its components, discarding any additional metrics

Provided Methods§

source

fn total_spectra(&self) -> usize

The total number of spectra in the group

source

fn earliest_spectrum(&self) -> Option<&S>

The spectrum that occurred first chronologically

source

fn latest_spectrum(&self) -> Option<&S>

The spectrum that occurred last chronologically

source

fn lowest_ms_level(&self) -> Option<u8>

The lowest MS level in the group

source

fn highest_ms_level(&self) -> Option<u8>

The highest MS level in the group

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<C, D, S> SpectrumGrouping<C, D, S> for SpectrumGroup<C, D, S>