pub struct ArrayPair<'lifespan> {
pub mz_array: Cow<'lifespan, [f64]>,
pub intensity_array: Cow<'lifespan, [f32]>,
pub min_mz: f64,
pub max_mz: f64,
}
Expand description
Represent an m/z array and an intensity array with independent
“borrowing” statuses using std::borrow::Cow
. Adds a few helper
methods.
Fields§
§mz_array: Cow<'lifespan, [f64]>
§intensity_array: Cow<'lifespan, [f32]>
§min_mz: f64
§max_mz: f64
Implementations§
source§impl<'lifespan> ArrayPair<'lifespan>
impl<'lifespan> ArrayPair<'lifespan>
pub fn wrap( mz_array: &'lifespan [f64], intensity_array: &'lifespan [f32] ) -> ArrayPair<'lifespan>
pub fn new( mz_array: Cow<'lifespan, [f64]>, intensity_array: Cow<'lifespan, [f32]> ) -> ArrayPair<'lifespan>
sourcepub fn find_between(&self, low: f64, high: f64) -> ArrayPair<'_>
pub fn find_between(&self, low: f64, high: f64) -> ArrayPair<'_>
Select the slice of the m/z and intensity arrays between low
m/z and high
m/z
returning a non-owning ArrayPair
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn get(&self, i: usize) -> Option<(f64, f32)>
pub fn borrow(&self) -> ArrayPair<'_>
pub fn to_owned(self) -> ArrayPair<'static>
Trait Implementations§
source§impl<'lifespan> Extend<ArrayPair<'lifespan>> for SignalAverager<'lifespan>
impl<'lifespan> Extend<ArrayPair<'lifespan>> for SignalAverager<'lifespan>
source§fn extend<T: IntoIterator<Item = ArrayPair<'lifespan>>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = ArrayPair<'lifespan>>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Auto Trait Implementations§
impl<'lifespan> RefUnwindSafe for ArrayPair<'lifespan>
impl<'lifespan> Send for ArrayPair<'lifespan>
impl<'lifespan> Sync for ArrayPair<'lifespan>
impl<'lifespan> Unpin for ArrayPair<'lifespan>
impl<'lifespan> UnwindSafe for ArrayPair<'lifespan>
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
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.