Struct msn_kit::spectrum::Spectrum[][src]

pub struct Spectrum {
    pub metadata: HashMap<String, String>,
    pub mz: Vec<f64>,
    pub intensities: Vec<f64>,
}
Expand description

Examples

The simplest spectrum with a single peak.

use std::collections::HashMap;

let s = msn_kit::spectrum::Spectrum::new(HashMap::<String, String>::new(), vec![1.0], vec![1.0]);
assert_eq!(s.mz, vec![1.0]);
assert_eq!(s.intensities, vec![1.0]);

Fields

metadata: HashMap<String, String>mz: Vec<f64>intensities: Vec<f64>

Implementations

Create a new Spectrum.

Arguments

  • metadata - The map of keys to values of the metadata.
  • mz - The mass to charge ratio vector.
  • intensities - The intensities vector.

Returns an empty is Spectrum.

Returns true if the Spectrum is empty.

Trait Implementations

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.