chematic_core/lib.rs
1#![forbid(unsafe_code)]
2//! `chematic-core` — core cheminformatics types for the chematic ecosystem.
3//!
4//! Provides:
5//! - [`Element`]: periodic-table element indexed by atomic number.
6//! - [`Atom`]: a single atom with element, charge, isotope, aromaticity, chirality.
7//! - [`BondOrder`] / [`BondEntry`]: bond types and graph edges.
8//! - [`Molecule`] / [`MoleculeBuilder`]: undirected molecular graph (no external graph lib).
9//! - [`implicit_hcount`]: valence-based implicit hydrogen count for organic-subset atoms.
10//! - [`kekulize`] / [`apply_kekule`]: assign alternating single/double bonds to aromatic systems.
11//!
12//! # Design principles
13//! - Pure Rust, no C/C++ FFI, no unsafe.
14//! - Zero external dependencies: compiles to wasm32-unknown-unknown without modification.
15//! - Domain-aware abstractions: graph types carry chemical semantics, not just topology.
16
17pub mod atom;
18pub mod bond;
19pub mod element;
20pub mod kekulization;
21pub mod molecule;
22pub mod valence;
23
24// Re-export the most commonly used types at crate root.
25pub use atom::{Atom, CipCode, Chirality};
26pub use bond::{BondEntry, BondOrder};
27pub use element::Element;
28pub use kekulization::{KekuleError, KekuleResult, apply_kekule, kekulize};
29pub use molecule::{AtomIdx, BondIdx, MolError, Molecule, MoleculeBuilder};
30pub use valence::{bond_order_sum, implicit_hcount, total_hcount};