| 1 | use superrust-analyzer cargo mendeleev 0.8.1 group/::Grouprust-analyzer cargo mendeleev 0.8.1 group/Group#; |
| 2 | use superrust-analyzer cargo mendeleev 0.8.1 group/::N_GROUPSrust-analyzer cargo mendeleev 0.8.1 group/N_GROUPS.; |
| 3 | |
| 4 | /// Array containing all periodic table groups, ordered by group number |
| 5 | /// |
| 6 | /// ``` |
| 7 | /// use mendeleev::Group; |
| 8 | /// use mendeleev::ALL_GROUPS; |
| 9 | /// use mendeleev::N_GROUPS; |
| 10 | /// |
| 11 | /// for n in 1..=N_GROUPS { |
| 12 | /// assert_eq!(ALL_GROUPS[n - 1].group_number() as usize, n); |
| 13 | /// } |
| 14 | /// ``` |
| 15 | pub const ALL_GROUPSrust-analyzer cargo mendeleev 0.8.1 group/array/ALL_GROUPS.: [Grouprust-analyzer cargo mendeleev 0.8.1 group/Group#; N_GROUPSrust-analyzer cargo mendeleev 0.8.1 group/N_GROUPS.] = [ |
| 16 | Grouprust-analyzer cargo mendeleev 0.8.1 group/Group#::IArust-analyzer cargo mendeleev 0.8.1 group/Group#IA#, |
| 17 | Grouprust-analyzer cargo mendeleev 0.8.1 group/Group#::IIArust-analyzer cargo mendeleev 0.8.1 group/Group#IIA#, |
| 18 | Grouprust-analyzer cargo mendeleev 0.8.1 group/Group#::IIIBrust-analyzer cargo mendeleev 0.8.1 group/Group#IIIB#, |
| 19 | Grouprust-analyzer cargo mendeleev 0.8.1 group/Group#::IVBrust-analyzer cargo mendeleev 0.8.1 group/Group#IVB#, |
| 20 | Grouprust-analyzer cargo mendeleev 0.8.1 group/Group#::VBrust-analyzer cargo mendeleev 0.8.1 group/Group#VB#, |
| 21 | Grouprust-analyzer cargo mendeleev 0.8.1 group/Group#::VIBrust-analyzer cargo mendeleev 0.8.1 group/Group#VIB#, |
| 22 | Grouprust-analyzer cargo mendeleev 0.8.1 group/Group#::VIIBrust-analyzer cargo mendeleev 0.8.1 group/Group#VIIB#, |
| 23 | Grouprust-analyzer cargo mendeleev 0.8.1 group/Group#::VIIIB8rust-analyzer cargo mendeleev 0.8.1 group/Group#VIIIB8#, |
| 24 | Grouprust-analyzer cargo mendeleev 0.8.1 group/Group#::VIIIB9rust-analyzer cargo mendeleev 0.8.1 group/Group#VIIIB9#, |
| 25 | Grouprust-analyzer cargo mendeleev 0.8.1 group/Group#::VIIIB10rust-analyzer cargo mendeleev 0.8.1 group/Group#VIIIB10#, |
| 26 | Grouprust-analyzer cargo mendeleev 0.8.1 group/Group#::IBrust-analyzer cargo mendeleev 0.8.1 group/Group#IB#, |
| 27 | Grouprust-analyzer cargo mendeleev 0.8.1 group/Group#::IIBrust-analyzer cargo mendeleev 0.8.1 group/Group#IIB#, |
| 28 | Grouprust-analyzer cargo mendeleev 0.8.1 group/Group#::IIIArust-analyzer cargo mendeleev 0.8.1 group/Group#IIIA#, |
| 29 | Grouprust-analyzer cargo mendeleev 0.8.1 group/Group#::IVArust-analyzer cargo mendeleev 0.8.1 group/Group#IVA#, |
| 30 | Grouprust-analyzer cargo mendeleev 0.8.1 group/Group#::VArust-analyzer cargo mendeleev 0.8.1 group/Group#VA#, |
| 31 | Grouprust-analyzer cargo mendeleev 0.8.1 group/Group#::VIArust-analyzer cargo mendeleev 0.8.1 group/Group#VIA#, |
| 32 | Grouprust-analyzer cargo mendeleev 0.8.1 group/Group#::VIIArust-analyzer cargo mendeleev 0.8.1 group/Group#VIIA#, |
| 33 | Grouprust-analyzer cargo mendeleev 0.8.1 group/Group#::VIIIArust-analyzer cargo mendeleev 0.8.1 group/Group#VIIIA#, |
| 34 | ]; |
| 35 | |
| 36 | impl Grouprust-analyzer cargo mendeleev 0.8.1 group/Group# { |
| 37 | /// Slice containing all groups, ordered by group number |
| 38 | /// |
| 39 | /// ``` |
| 40 | /// use mendeleev::Group; |
| 41 | /// use mendeleev::N_GROUPS; |
| 42 | /// |
| 43 | /// for n in 1..=N_GROUPS { |
| 44 | /// assert_eq!(Group::list()[n - 1].group_number() as usize, n); |
| 45 | /// } |
| 46 | /// ``` |
| 47 | pub const fn listrust-analyzer cargo mendeleev 0.8.1 group/array/impl#[Group]list().() -> &'static [Selfrust-analyzer cargo mendeleev 0.8.1 group/array/impl#[Group]] { |
| 48 | &ALL_GROUPSrust-analyzer cargo mendeleev 0.8.1 group/array/ALL_GROUPS. |
| 49 | } |
| 50 | |
| 51 | /// Returns an iterator that yields all the groups by value, ordered by group number |
| 52 | /// |
| 53 | /// ``` |
| 54 | /// use mendeleev::Group; |
| 55 | /// |
| 56 | /// assert_eq!(Group::iter().next(), Some(Group::IA)); |
| 57 | /// ``` |
| 58 | pub fn iterrust-analyzer cargo mendeleev 0.8.1 group/array/impl#[Group]iter().() -> impl Iteratorrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#<Itemrust-analyzer cargo core https://github.com/rust-lang/rust/library/core iter/traits/iterator/Iterator#Item# = Selfrust-analyzer cargo mendeleev 0.8.1 group/array/impl#[Group]> + Clonerust-analyzer cargo core https://github.com/rust-lang/rust/library/core clone/Clone# { |
| 59 | ALL_GROUPSrust-analyzer cargo mendeleev 0.8.1 group/array/ALL_GROUPS..into_iterrust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/iter/impl#[`[T; N]`][IntoIterator]into_iter().() |
| 60 | } |
| 61 | } |