pub trait AsyncIonMobilityFrameSource<C: FeatureLike<MZ, IonMobility> = Feature<MZ, IonMobility>, D: FeatureLike<Mass, IonMobility> + KnownCharge = ChargedFeature<Mass, IonMobility>, S: IonMobilityFrameLike<C, D> = MultiLayerIonMobilityFrame<C, D>>: Send {
Show 15 methods
// Required methods
fn reset(&mut self) -> impl Future<Output = ()>;
fn detail_level(&self) -> &DetailLevel;
fn set_detail_level(&mut self, detail_level: DetailLevel);
fn get_frame_by_id(&mut self, id: &str) -> impl Future<Output = Option<S>>;
fn get_frame_by_index(
&mut self,
index: usize,
) -> impl Future<Output = Option<S>>;
fn get_index(&self) -> &OffsetIndex;
fn set_index(&mut self, index: OffsetIndex);
fn read_next_frame(&mut self) -> impl Future<Output = Option<S>>;
// Provided methods
async fn get_frame_by_time(&mut self, time: f64) -> Option<S> { ... }
fn len(&self) -> usize { ... }
fn is_empty(&self) -> bool { ... }
fn _offset_of_id(&self, id: &str) -> Option<u64> { ... }
fn _offset_of_index(&self, index: usize) -> Option<u64> { ... }
async fn _offset_of_time(&mut self, time: f64) -> Option<u64> { ... }
fn as_stream(&mut self) -> impl IonMobilityFrameStream<C, D, S> + Unpin + '_ { ... }
}Expand description
An asynchronous analog of IonMobilityFrameSource, the base trait defining
the behaviors of an async source of ion mobility frames.
This is the frame-side mirror of
AsyncSpectrumSource.
Required Methods§
Sourcefn reset(&mut self) -> impl Future<Output = ()>
fn reset(&mut self) -> impl Future<Output = ()>
Rewind the current position of the source to the beginning
Sourcefn detail_level(&self) -> &DetailLevel
fn detail_level(&self) -> &DetailLevel
Get the DetailLevel the reader currently uses
Sourcefn set_detail_level(&mut self, detail_level: DetailLevel)
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
frame.
§Note
Not all readers support all detail levels, and the behavior when requesting one of those levels will depend upon the underlying reader.
Sourcefn get_frame_by_id(&mut self, id: &str) -> impl Future<Output = Option<S>>
fn get_frame_by_id(&mut self, id: &str) -> impl Future<Output = Option<S>>
Retrieve a frame by it’s native ID
Sourcefn get_frame_by_index(
&mut self,
index: usize,
) -> impl Future<Output = Option<S>>
fn get_frame_by_index( &mut self, index: usize, ) -> impl Future<Output = Option<S>>
Retrieve a frame by it’s integer index
Sourcefn get_index(&self) -> &OffsetIndex
fn get_index(&self) -> &OffsetIndex
Access the frame offset index to enumerate all frames by ID
Sourcefn set_index(&mut self, index: OffsetIndex)
fn set_index(&mut self, index: OffsetIndex)
Set the frame offset index. This method shouldn’t be needed if not writing a new adapter
Sourcefn read_next_frame(&mut self) -> impl Future<Output = Option<S>>
fn read_next_frame(&mut self) -> impl Future<Output = Option<S>>
Read the next frame from the source, advancing the current position
Provided Methods§
Sourceasync fn get_frame_by_time(&mut self, time: f64) -> Option<S>
async fn get_frame_by_time(&mut self, time: f64) -> Option<S>
Retrieve a frame by its scan start time Considerably more complex than seeking by ID or index, this involves a binary search over the frame index and assumes that frames are stored in chronological order.
Sourcefn len(&self) -> usize
fn len(&self) -> usize
Retrieve the number of frames in source file, usually by getting the length of the index. If the index isn’t initialized, this will be 0.
fn is_empty(&self) -> bool
Sourcefn _offset_of_id(&self, id: &str) -> Option<u64>
fn _offset_of_id(&self, id: &str) -> Option<u64>
Helper method to support seeking to an ID
Sourcefn _offset_of_index(&self, index: usize) -> Option<u64>
fn _offset_of_index(&self, index: usize) -> Option<u64>
Helper method to support seeking to an index
Sourceasync fn _offset_of_time(&mut self, time: f64) -> Option<u64>
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.
Sourcefn as_stream(&mut self) -> impl IonMobilityFrameStream<C, D, S> + Unpin + '_
fn as_stream(&mut self) -> impl IonMobilityFrameStream<C, D, S> + Unpin + '_
Wrap this source in a Stream over its frames
The returned stream is Unpin, so it can be driven directly with
StreamExt::next without pinning it first.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".