Skip to main content

AsyncMZReaderType

Enum AsyncMZReaderType 

Source
#[non_exhaustive]
pub enum AsyncMZReaderType<R: AsyncRead + AsyncSeek + Unpin + Send, C: CentroidLike + From<CentroidPeak> + BuildFromArrayMap + Send + Sync = CentroidPeak, D: DeconvolutedCentroidLike + From<DeconvolutedPeak> + BuildFromArrayMap + Send + Sync = DeconvolutedPeak> { MzML(AsyncMzMLReaderType<R, C, D>), MGF(AsyncMGFReaderType<R, C, D>), }

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

MzML(AsyncMzMLReaderType<R, C, D>)

§

MGF(AsyncMGFReaderType<R, C, D>)

Implementations§

Trait Implementations§

Source§

impl<R: AsyncRead + AsyncSeek + Unpin + Send, C: CentroidLike + From<CentroidPeak> + BuildFromArrayMap + Send + Sync + 'static, D: DeconvolutedCentroidLike + From<DeconvolutedPeak> + BuildFromArrayMap + Send + Sync + 'static> AsyncIntoIonMobilityFrameSource<C, D> for AsyncMZReaderType<R, C, D>

Unlike the synchronous MZReaderType, every variant here is converted through AsyncGeneric3DIonMobilityFrameSource. There is no dispatch-based async ion mobility type yet do to lack of native support for async reading in existing formats.

Source§

type IonMobilityFrameSource<CF: FeatureLike<MZ, IonMobility> + Send + Sync, DF: FeatureLike<Mass, IonMobility> + KnownCharge + Send + Sync> = AsyncGeneric3DIonMobilityFrameSource<C, D, AsyncMZReaderType<R, C, D>, CF, DF>

Source§

async fn try_into_frame_source<CF: FeatureLike<MZ, IonMobility> + Send + Sync, DF: FeatureLike<Mass, IonMobility> + KnownCharge + Send + Sync>( self, ) -> Result<Self::IonMobilityFrameSource<CF, DF>, IntoIonMobilityFrameSourceError>

Attempt to convert the AsyncSpectrumSource into an AsyncIonMobilityFrameSource, returning IntoIonMobilityFrameSourceError if it is not possible
Source§

async fn into_frame_source<CF: FeatureLike<MZ, IonMobility> + Send + Sync, DF: FeatureLike<Mass, IonMobility> + KnownCharge + Send + Sync>( self, ) -> Self::IonMobilityFrameSource<CF, DF>

Call AsyncIntoIonMobilityFrameSource::try_into_frame_source, panicking if an error is returned.
Source§

async fn has_ion_mobility(&mut self) -> Option<HasIonMobility>

Reads a sparse 1% of the entries from the AsyncSpectrumSource, testing for the presence of ion mobility data.
Source§

impl<C: CentroidLike + From<CentroidPeak> + BuildFromArrayMap + Send + Sync + 'static, D: DeconvolutedCentroidLike + From<DeconvolutedPeak> + BuildFromArrayMap + Send + Sync + 'static> AsyncMZFileReader<C, D> for AsyncMZReaderType<File, C, D>

Available on crate feature async only.
Source§

async fn construct_index_from_stream(&mut self) -> u64

An on-trait method of constructing an index. Assumed to be a trivial wrapper.
Source§

async fn open_path<P>(path: P) -> Result<Self>
where P: Into<PathBuf>,

The preferred method of opening a file from a path-like object. This method will open the file at the provided path, test whether there is an accompanied index file next to it on the file system, and if not, build one and save it or otherwise read in the index. Read more
Source§

async fn open_file(source: File) -> Result<Self>

Given a regular file, construct a new instance without indexing.
Source§

impl<R: AsyncRead + AsyncSeek + Unpin + Send, C: CentroidLike + From<CentroidPeak> + BuildFromArrayMap + Send + Sync + 'static, D: DeconvolutedCentroidLike + From<DeconvolutedPeak> + BuildFromArrayMap + Send + Sync + 'static> AsyncRandomAccessSpectrumIterator<C, D> for AsyncMZReaderType<R, C, D>

Source§

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

Source§

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

Source§

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

Source§

impl<R: AsyncRead + AsyncSeek + Unpin + Send, C: CentroidLike + From<CentroidPeak> + BuildFromArrayMap + Send + Sync + 'static, D: DeconvolutedCentroidLike + From<DeconvolutedPeak> + BuildFromArrayMap + Send + Sync + 'static> AsyncSpectrumSource<C, D> for AsyncMZReaderType<R, C, D>

Source§

async fn reset(&mut self)

Rewind the current position of the source to the beginning
Source§

fn detail_level(&self) -> &DetailLevel

Get the DetailLevel the reader currently uses
Source§

fn set_detail_level(&mut self, detail_level: DetailLevel)

Set the DetailLevel for the reader, changing the amount of work done immediately on loading a spectrum. Read more
Source§

async fn get_spectrum_by_id( &mut self, id: &str, ) -> Option<MultiLayerSpectrum<C, D>>

Retrieve a spectrum by it’s native ID
Source§

async fn get_spectrum_by_index( &mut self, index: usize, ) -> Option<MultiLayerSpectrum<C, D>>

Retrieve a spectrum by it’s integer index
Source§

async fn get_spectrum_by_time( &mut self, time: f64, ) -> Option<MultiLayerSpectrum<C, D>>

Retrieve a spectrum by its scan start time Considerably more complex than seeking by ID or index, this involves a binary search over the spectrum index and assumes that spectra are stored in chronological order.
Source§

fn get_index(&self) -> &OffsetIndex

Access the spectrum offset index to enumerate all spectra by ID
Source§

fn set_index(&mut self, index: OffsetIndex)

Set the spectrum offset index. This method shouldn’t be needed if not writing a new adapter
Source§

async fn read_next(&mut self) -> Option<MultiLayerSpectrum<C, D>>

Source§

fn len(&self) -> usize

Retrieve the number of spectra in source file, usually by getting the length of the index. If the index isn’t initialized, this will be 0.
Source§

fn is_empty(&self) -> bool

Source§

fn _offset_of_id(&self, id: &str) -> Option<u64>

Helper method to support seeking to an ID
Source§

fn _offset_of_index(&self, index: usize) -> Option<u64>

Helper method to support seeking to an index
Source§

async fn _offset_of_time(&mut self, time: f64) -> Option<u64>

Helper method to support seeking to a specific time. Considerably more complex than seeking by ID or index.
Source§

fn as_stream(&mut self) -> impl SpectrumStream<C, D, S> + Unpin + '_

Wrap this source in a Stream over its spectra Read more
Source§

impl<R: AsyncRead + AsyncSeek + Unpin + Send, C: CentroidLike + From<CentroidPeak> + BuildFromArrayMap + Send + Sync + 'static, D: DeconvolutedCentroidLike + From<DeconvolutedPeak> + BuildFromArrayMap + Send + Sync + 'static> MSDataFileMetadata for AsyncMZReaderType<R, C, D>

Source§

fn data_processings(&self) -> &Vec<DataProcessing>

The series of DataProcessing workflows applied to spectra in this data file.
Source§

fn instrument_configurations(&self) -> &HashMap<u32, InstrumentConfiguration>

A mapping over different InstrumentConfiguration modes that spectra were acquired under.
Source§

fn file_description(&self) -> &FileDescription

A description of the contents and the sources for this mass spectrometry data file.
Source§

fn softwares(&self) -> &Vec<Software>

The series of Software applied to the data file to apply different DataProcessing methods.
Source§

fn samples(&self) -> &Vec<Sample>

A list of sample descriptions that were measured in this data file if available.
Source§

fn data_processings_mut(&mut self) -> &mut Vec<DataProcessing>

Mutably access the DataProcessing list for this data file
Source§

fn instrument_configurations_mut( &mut self, ) -> &mut HashMap<u32, InstrumentConfiguration>

Mutably access the InstrumentConfiguration mapping for this data file
Source§

fn file_description_mut(&mut self) -> &mut FileDescription

Mutably access the FileDescription description of the contents and the sources for this mass spectrometry data file.
Source§

fn softwares_mut(&mut self) -> &mut Vec<Software>

Mutably access the list of Software of this data file.
Source§

fn samples_mut(&mut self) -> &mut Vec<Sample>

Source§

fn source_file_name(&self) -> Option<&str>

Get the name of the primary source file, if available
Source§

fn run_description(&self) -> Option<&MassSpectrometryRun>

Access the MassSpectrometryRun metadata record if it is available
Source§

fn spectrum_count_hint(&self) -> Option<u64>

A hint about how many spectra are in this data file
Source§

fn scan_settings(&self) -> Option<&Vec<ScanSettings>>

A list of scan settings in ScanSettings pre-configured by the instrument operator prior to the start of data acquisition. Read more
Source§

fn scan_settings_mut(&mut self) -> Option<&mut Vec<ScanSettings>>

Mutably access the list of ScanSettings for this dataset. Most formats do not possess a related concept and will not carry one.
Source§

fn copy_metadata_from(&mut self, source: &impl MSDataFileMetadata)
where Self: Sized,

Copy the metadata from another MSDataFileMetadata implementation into this one.
Source§

fn set_spectrum_count_hint(&mut self, _value: Option<u64>)

Source§

fn run_description_mut(&mut self) -> Option<&mut MassSpectrometryRun>

Mutably access the MassSpectrometryRun metadata record if it is available

Auto Trait Implementations§

§

impl<R, C = CentroidPeak, D = DeconvolutedPeak> !RefUnwindSafe for AsyncMZReaderType<R, C, D>

§

impl<R, C = CentroidPeak, D = DeconvolutedPeak> !UnwindSafe for AsyncMZReaderType<R, C, D>

§

impl<R, C, D> Freeze for AsyncMZReaderType<R, C, D>
where MzMLReaderType<R, C, D>: Freeze, MGFReaderType<R, C, D>: Freeze,

§

impl<R, C, D> Send for AsyncMZReaderType<R, C, D>
where MzMLReaderType<R, C, D>: Send, MGFReaderType<R, C, D>: Send,

§

impl<R, C, D> Sync for AsyncMZReaderType<R, C, D>
where MzMLReaderType<R, C, D>: Sync, MGFReaderType<R, C, D>: Sync,

§

impl<R, C, D> Unpin for AsyncMZReaderType<R, C, D>
where MzMLReaderType<R, C, D>: Unpin, MGFReaderType<R, C, D>: Unpin,

§

impl<R, C, D> UnsafeUnpin for AsyncMZReaderType<R, C, D>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more