pub struct VecSource {
pub metadata: RunMetadata,
pub records: Vec<SpectrumRecord>,
}Expand description
A trivial in-memory openproteo_core::SpectrumSource backed by a
Vec<SpectrumRecord> + a openproteo_core::RunMetadata. Hand it
to openproteo_core::write_mzml when you already have the records
in hand and just want to emit mzML.
Fields§
§metadata: RunMetadata§records: Vec<SpectrumRecord>Implementations§
Source§impl VecSource
impl VecSource
pub fn new(metadata: RunMetadata, records: Vec<SpectrumRecord>) -> Self
Trait Implementations§
Source§impl SpectrumSource for VecSource
impl SpectrumSource for VecSource
Source§fn run_metadata(&self) -> RunMetadata
fn run_metadata(&self) -> RunMetadata
Run-level metadata. Cheap to call; vendors typically build this once.
Source§fn iter_spectra<'s>(
&'s mut self,
) -> Box<dyn Iterator<Item = SpectrumRecord> + 's>
fn iter_spectra<'s>( &'s mut self, ) -> Box<dyn Iterator<Item = SpectrumRecord> + 's>
Iterate every spectrum the file contains. Spectra the parser cannot
decode should be skipped silently; the writer trusts whatever the
iterator yields. Read more
Source§fn spectrum_count_hint(&self) -> Option<usize>
fn spectrum_count_hint(&self) -> Option<usize>
Total number of spectra the source will yield, when known cheaply.
Used by the mzML writer to populate
<spectrumList count="...">. If
None, the writer falls back to buffering spectrum offsets and
patching the count at the end.Source§fn iter_chromatograms<'a>(
&'a mut self,
) -> Box<dyn Iterator<Item = ChromatogramRecord> + 'a>
fn iter_chromatograms<'a>( &'a mut self, ) -> Box<dyn Iterator<Item = ChromatogramRecord> + 'a>
Iterate chromatogram traces (TIC, BPC, SRM). Defaults to an empty
iterator; most parsers do not synthesize chromatograms.
Auto Trait Implementations§
impl Freeze for VecSource
impl RefUnwindSafe for VecSource
impl Send for VecSource
impl Sync for VecSource
impl Unpin for VecSource
impl UnsafeUnpin for VecSource
impl UnwindSafe for VecSource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more