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