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>

source

pub fn wrap( mz_array: &'lifespan [f64], intensity_array: &'lifespan [f32] ) -> ArrayPair<'lifespan>

source

pub fn new( mz_array: Cow<'lifespan, [f64]>, intensity_array: Cow<'lifespan, [f32]> ) -> ArrayPair<'lifespan>

source

pub fn find(&self, mz: f64) -> usize

Find the index nearest to mz

source

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

source

pub fn len(&self) -> usize

source

pub fn is_empty(&self) -> bool

source

pub fn get(&self, i: usize) -> Option<(f64, f32)>

source

pub fn borrow(&self) -> ArrayPair<'_>

source

pub fn to_owned(self) -> ArrayPair<'static>

Trait Implementations§

source§

impl<'lifespan> Clone for ArrayPair<'lifespan>

source§

fn clone(&self) -> ArrayPair<'lifespan>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'lifespan> Debug for ArrayPair<'lifespan>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'lifespan> Default for ArrayPair<'lifespan>

source§

fn default() -> ArrayPair<'lifespan>

Returns the “default value” for a type. Read more
source§

impl<'lifespan> Extend<ArrayPair<'lifespan>> for SignalAverager<'lifespan>

source§

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)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

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
source§

impl<'lifespan> From<(&'lifespan [f64], &'lifespan [f32])> for ArrayPair<'lifespan>

source§

fn from(pair: (&'lifespan [f64], &'lifespan [f32])) -> ArrayPair<'lifespan>

Converts to this type from the input type.
source§

impl<'lifespan> From<(Cow<'lifespan, [f64]>, Cow<'lifespan, [f32]>)> for ArrayPair<'lifespan>

source§

fn from( pair: (Cow<'lifespan, [f64]>, Cow<'lifespan, [f32]>) ) -> ArrayPair<'lifespan>

Converts to this type from the input type.
source§

impl<'lifespan> From<(Vec<f64>, Vec<f32>)> for ArrayPair<'lifespan>

source§

fn from(pair: (Vec<f64>, Vec<f32>)) -> ArrayPair<'lifespan>

Converts to this type from the input type.

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

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

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

Initializes a with the given initializer. Read more
§

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

Dereferences the given pointer. Read more
§

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

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

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

impl<T> Same for T

§

type Output = T

Should always be Self
§

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

§

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

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

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

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

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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.