readcon_core/lib.rs
1pub mod array;
2pub mod compression;
3pub mod error;
4pub mod ffi;
5pub mod helpers;
6pub mod iterators;
7pub mod parser;
8pub mod types;
9pub mod writer;
10
11#[cfg(feature = "metatensor")]
12pub mod metatensor_export;
13
14/// Chemfiles multi-format import (real impl behind `chemfiles` feature; stubs otherwise).
15pub mod chemfiles_import;
16
17/// Chemfiles selection grammar on CON frames (real impl behind `chemfiles` feature; stubs otherwise).
18pub mod chemfiles_selection;
19
20#[cfg(feature = "rpc")]
21pub mod rpc;
22
23// Re-export for generated capnp code which references crate::ReadCon_capnp
24#[cfg(feature = "rpc")]
25pub use rpc::read_con_capnp as ReadCon_capnp;
26
27#[cfg(feature = "python")]
28pub mod python;
29
30/// CON/convel format spec version implemented by this build.
31///
32/// - Version 1: column 5 present but semantics undefined. Readers MAY
33/// ignore it. No JSON metadata line.
34/// - Version 2: column 5 is the original atom index before type-based
35/// grouping. Readers MUST parse and preserve it. Writers MUST write
36/// the stored value. Line 2 of the header carries a JSON object
37/// with at least `{"con_spec_version": 2}`.
38///
39/// See `docs/orgmode/spec.org` for the full specification.
40pub const CON_SPEC_VERSION: u32 = 2;
41
42/// Library version string, injected from Cargo.toml at compile time.
43pub const VERSION: &str = env!("CARGO_PKG_VERSION");
44
45#[cfg(test)]
46mod tests {
47 use super::*;
48
49 #[test]
50 fn test_spec_version_is_2() {
51 assert_eq!(CON_SPEC_VERSION, 2);
52 assert_eq!(ffi::RKR_CON_SPEC_VERSION, CON_SPEC_VERSION);
53 }
54
55 #[test]
56 fn test_version_matches_cargo() {
57 assert_eq!(VERSION, "0.13.1");
58 }
59}