Trait RandomAccessSpectrumIterator

Source
pub trait RandomAccessSpectrumIterator<C = CentroidPeak, D = DeconvolutedPeak, S = MultiLayerSpectrum<C, D>>: SpectrumSource<C, D, S>{
    // Required methods
    fn start_from_id(
        &mut self,
        id: &str,
    ) -> Result<&mut Self, SpectrumAccessError>;
    fn start_from_index(
        &mut self,
        index: usize,
    ) -> Result<&mut Self, SpectrumAccessError>;
    fn start_from_time(
        &mut self,
        time: f64,
    ) -> Result<&mut Self, SpectrumAccessError>;
}
Expand description

An extension of SpectrumSource that supports relocatable iteration relative to a specific spectrum coordinate or identifier.

Required Methods§

Source

fn start_from_id(&mut self, id: &str) -> Result<&mut Self, SpectrumAccessError>

Start iterating from the spectrum whose native ID matches id

Source

fn start_from_index( &mut self, index: usize, ) -> Result<&mut Self, SpectrumAccessError>

Start iterating from the spectrum whose index is index

Source

fn start_from_time( &mut self, time: f64, ) -> Result<&mut Self, SpectrumAccessError>

Start iterating from the spectrum starting closest to time

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<C, D, R> RandomAccessSpectrumIterator<C, D> for MZReaderType<R, C, D>

Source§

impl<C, D, S> RandomAccessSpectrumIterator<C, D, S> for MemorySpectrumSource<C, D, S>

Source§

impl<C, D, S, I> RandomAccessSpectrumIterator<C, D, S> for StreamingSpectrumIterator<C, D, S, I>
where C: CentroidLike, D: DeconvolutedCentroidLike, S: SpectrumLike<C, D>, I: Iterator<Item = S>,

StreamingSpectrumIterator implements RandomAccessSpectrumIterator in a limited fashion by reading through successive spectra until the target spectrum is found. This will exhaust the underlying iterator if the requested coordinate is not found.

Source§

impl<C, D, S, R> RandomAccessSpectrumIterator<C, D, S> for SpectrumIterator<'_, C, D, S, R>