Skip to main content

VecSource

Struct VecSource 

Source
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

Source

pub fn new(metadata: RunMetadata, records: Vec<SpectrumRecord>) -> Self

Trait Implementations§

Source§

impl SpectrumSource for VecSource

Source§

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>

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>

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>

Iterate chromatogram traces (TIC, BPC, SRM). Defaults to an empty iterator; most parsers do not synthesize chromatograms.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.