Skip to main content

molframe_cif/
lib.rs

1//! Reading and writing PDBx/mmCIF.
2//!
3//! The format the archive actually distributes, and the one every other
4//! structural format is now defined against. Reading it happens in two steps
5//! that are deliberately separate: a document that preserves what the file said,
6//! and a structure that says what it means. Keeping them apart is what lets a
7//! file survive a round trip through categories this library has no
8//! interpretation for.
9
10#![forbid(unsafe_code)]
11
12mod batch;
13pub mod document;
14pub mod lexer;
15mod lower;
16mod parser;
17mod pdbml;
18mod reader;
19mod small_cif;
20mod write;
21
22pub use batch::MmcifBatchSource;
23pub use document::{Category, CifValue, Column, DataBlock, Document};
24pub use lower::lower;
25#[doc(hidden)]
26pub use lower::{
27    AtomSiteRow, AtomSiteRowSink, Field, lower_atom_site_with, lower_ragged_atom_site_with,
28    lower_single_atom_site_with,
29};
30#[doc(hidden)]
31pub use parser::{CifEventSink, CifScalar, parse_events};
32pub use parser::{ParseResult, Rows, parse, split_tag};
33pub use pdbml::{PdbmlError, PdbmlReadError, parse_pdbml_document, read_pdbml, write_pdbml};
34pub use reader::{CifReader, read, read_with_document};
35#[doc(hidden)]
36pub use reader::{ProjectedReadResult, read_with_metadata, read_with_projection};
37pub use small_cif::{
38    SmallCifAtom, SmallCifBond, SmallCifDialect, SmallCifError, SmallCifOptions, SmallCifStructure,
39    lower_small_cif, lower_small_cif_with_options,
40};
41#[doc(hidden)]
42pub use write::{
43    CanonicalAtomRow, CanonicalProjection, CanonicalValue, canonical_projection,
44    declared_polymer_types,
45};
46pub use write::{
47    CifWriteError, CifWriteOptions, CifWriteToError, quote_text, render_value, write_canonical,
48    write_canonical_to, write_canonical_with_options, write_preserving, write_preserving_to,
49    write_quoted,
50};