#element #constant #macro #create #load #chemistru #load-elements

yanked chemistru-elements-macro

Create Constants For Every Element

1 unstable release

0.3.0 Oct 9, 2023
0.2.2 Oct 9, 2023
0.2.1 Oct 9, 2023
0.2.0 Oct 9, 2023
0.1.0 Oct 2, 2023

#131 in #constant


Used in chemistru-elements-list

Custom license and maybe GPL-3.0

33KB
190 lines

chemistru-elements-macro

Requirements

This macro depends on the chemistru-elements crate for the Element type.

Function / Use

Using the load_elements macro will create a constant of type chemistru_elements::Element for every element.

Example:

use chemistru_element::Element;
use chemistru_element_macro::load_elements;

mod elements {
    load_elements!();
}

fn f() {
    let water = (Elements::HYDROGEN, Elements::OXYGEN, Elements::HYDROGEN);
}

Attribution

Periodic table data provided by Bowserinator (github)

Dependencies

~0–405KB