Skip to main content

readcon_core/
lib.rs

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