Crate ame2020

source ·
Expand description

A parsing library for the Atomic Mass Evaluation 2020 format

The data is represented by Nuclide, and the parsing is mostly done by Iter. The data can be collected into a type that implements FromIterator, such as Vec.

Format

The format is documented in the preamble of the AME data file itself. This library parses data formatted like the mass.mas20 file. The rounded version, and previous versions, such as AME2016 are incompatible.

Examples

use ame2020::{Iter, Nuclide};
use std::{fs::File, io::BufReader};

let file = File::open("mass.mas20")?;
let file = BufReader::new(file);
let iter = Iter::new(file);
let data: Vec<Nuclide> = iter.collect::<Result<_, _>>()?;

Features

  • serde: Provide Serialize and Deserialize implementations for serde.
  • arbitrary: Provide Arbitrary implementations for arbitrary, useful for fuzzing.

Structs

An iterator that reads AME2020 data.
A type holding the nuclide data.
A value that has a mean and uncertainty.

Enums

A reading or parsing error.