chemrust_core/data/atom/atom_data.rs
1use castep_periodic_table::element::ElementSymbol;
2
3use crate::data::geom::coordinates::CoordData;
4
5/// Basic `component`s for atom site data.
6/// Custom type to extend fields for `AtomData` can be fitted in `CrystalModel` by
7/// implementing this trait
8pub trait CoreAtomData {
9 fn indices_repr(&self) -> Vec<usize>;
10 fn symbols_repr(&self) -> Vec<ElementSymbol>;
11 fn coords_repr(&self) -> Vec<CoordData>;
12 fn labels_repr(&self) -> Vec<Option<String>>;
13}
14
15// /// Basic example struct
16// #[derive(Debug, Clone)]
17// pub struct Atoms {
18// indices: Vec<usize>,
19// symbols: Vec<ElementSymbol>,
20// coordinates: Vec<CoordData>,
21// labels: Vec<Option<String>>,
22// }
23
24// impl Atoms {
25// pub fn new(
26// indices: Vec<usize>,
27// symbols: Vec<ElementSymbol>,
28// coordinates: Vec<CoordData>,
29// labels: Vec<Option<String>>,
30// ) -> Self {
31// Self {
32// indices,
33// symbols,
34// coordinates,
35// labels,
36// }
37// }
38// }
39
40// impl CoreAtomData for Atoms {
41// fn indices(&self) -> &[usize] {
42// &self.indices
43// }
44
45// fn symbols(&self) -> &[ElementSymbol] {
46// &self.symbols
47// }
48
49// fn coords(&self) -> &[CoordData] {
50// &self.coordinates
51// }
52
53// fn labels(&self) -> &[Option<String>] {
54// &self.labels
55// }
56// }