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§
Sourcefn start_from_id(&mut self, id: &str) -> Result<&mut Self, SpectrumAccessError>
fn start_from_id(&mut self, id: &str) -> Result<&mut Self, SpectrumAccessError>
Start iterating from the spectrum whose native ID matches id
Sourcefn start_from_index(
&mut self,
index: usize,
) -> Result<&mut Self, SpectrumAccessError>
fn start_from_index( &mut self, index: usize, ) -> Result<&mut Self, SpectrumAccessError>
Start iterating from the spectrum whose index is index
Sourcefn start_from_time(
&mut self,
time: f64,
) -> Result<&mut Self, SpectrumAccessError>
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§
impl<C, D, R> RandomAccessSpectrumIterator<C, D> for MZReaderType<R, C, D>where
C: CentroidLike + From<CentroidPeak> + BuildFromArrayMap,
D: DeconvolutedCentroidLike + From<DeconvolutedPeak> + BuildFromArrayMap,
R: Read + Seek,
impl<C, D, S> RandomAccessSpectrumIterator<C, D, S> for MemorySpectrumSource<C, D, S>
impl<C, D, S, I> RandomAccessSpectrumIterator<C, D, S> for StreamingSpectrumIterator<C, D, S, I>
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.