Skip to main content

molframe_core/
lib.rs

1//! Core types, storage and analysis contracts for molframe.
2//!
3//! This crate holds the vocabulary every other molframe crate speaks: the typed
4//! positions into a structure's tables, the interned identifiers, the chunked
5//! columnar store the coordinates and annotations live in, the immutable
6//! [`Structure`] built over it, and the contract types
7//! that make an analysis state what it assumed.
8//!
9//! It has almost no dependencies and no input or output of its own, so a project
10//! that wants only the types pays for only the types. Memory mapping and
11//! decompression are behind features for the same reason.
12//!
13//! # Layout
14//!
15//! - [`index`] — typed positions; a residue position is not an atom position.
16//! - [`element`] — element identity, and recovering one from an atom name.
17//! - [`span`] — where in a source file something was.
18//! - [`diagnostic`] — findings about data, returned alongside success.
19//! - [`symbol`] — interned identifiers, so no kernel compares strings.
20
21#![forbid(unsafe_code)]
22
23pub mod annotation;
24pub mod bond;
25pub mod chunk;
26pub mod column;
27pub mod contract;
28pub mod coords;
29pub mod diagnostic;
30pub mod element;
31pub mod execution;
32pub mod hashing;
33pub mod index;
34pub mod io;
35pub mod limits;
36pub mod optional;
37pub mod parallel;
38pub mod provider;
39pub mod selection;
40pub mod span;
41pub mod structure;
42pub mod symbol;
43pub mod topology;
44
45pub use annotation::{
46    AROMATIC_ATOM_ANNOTATION, ATOM_RADIUS_ANNOTATION, AUTODOCK_TYPE_ANNOTATION, AnnotationColumn,
47    AtomAnnotation, AtomAnnotations, COMPONENT_KIND_ANNOTATION, FORMAL_CHARGE_ANNOTATION,
48    HBOND_ACCEPTOR_ANNOTATION, HBOND_DONOR_ANNOTATION, PAE_ANNOTATION, PARTIAL_CHARGE_ANNOTATION,
49    PLDDT_ANNOTATION, POLYMER_ATOM_ROLE_ANNOTATION, SEGMENT_ID_ANNOTATION,
50    STEREO_CONFIGURATION_ANNOTATION,
51};
52pub use bond::{BondAdjacency, BondOrder, BondProvenance, BondRecord, BondTable, BondTableBuilder};
53pub use chunk::{
54    AtomChunk, AtomChunkStats, ChunkBuilder, ElementMask, Extremes, ParentMapping,
55    TARGET_CHUNK_ATOMS,
56};
57pub use column::{BitVec, EncodedColumn, Presence, ValidityMask};
58pub use contract::{Analysis, AnalysisPolicy, Coverage, Provenance, Status};
59pub use coords::{Aabb, CoordinateBlock, CoordinateGeneration};
60pub use diagnostic::{
61    Class, Code, ContextItem, Diagnostic, Diagnostics, Findings, Kind, Rendered, Severity,
62    Strictness,
63};
64pub use element::Element;
65pub use execution::{
66    Backpressure, Batch, BatchDemand, BatchLease, BatchSource, CancellationToken, Cancelled,
67    ContextError, ExecutionContext, ExecutionContextBuilder, MemoryBudget, MemoryBudgetError,
68    MemoryReservation, ScratchPolicy, SpillArtifact, SpillError, SpillFile, SpillReader,
69    TempStoragePolicy,
70};
71pub use index::{
72    AtomIndex, BondIndex, ChainIndex, EntityIndex, InstanceId, ModelIndex, ResidueIndex,
73};
74pub use io::{
75    AmbiguousResidueBoundaryPolicy, BatchContinuity, ByteWindow, ContinuityLevel, Format,
76    InputBuffer, InputKind, MissingElementPolicy, ParseMode, ReadOptions, ReadResult, SourceBytes,
77    SpillWindowedFile, StructureAtomRecord, StructureBatch, StructureBatchBuffer,
78    StructureBatchBuilder, StructureBatchError, StructureBatchPool, WindowedFile,
79    WindowedSourceFile, collect_structure, write_output,
80};
81pub use limits::{CapacityError, TableError};
82pub use optional::{OptionalI32, OptionalSymbol};
83pub use provider::{
84    AtomEndpoint, BondChunk, BondChunkProvider, BondChunkRecord, ChunkDescriptor, ChunkId,
85    ChunkLayout, DatasetCatalog, DatasetDescriptor, DatasetId, FrameChunk, FrameChunkProvider,
86    LocalRow, LogicalRow, PayloadKind, PropertyChunk, PropertyChunkProvider, PropertyKind,
87    PropertyValue, ProviderError, StructureChunk, StructureChunkProvider, TARGET_CHUNK_BONDS,
88};
89pub use selection::AtomSelection;
90pub use span::{ByteSpan, Position};
91pub use structure::{
92    CountDifference, DifferenceError, ExtensionStore, MetadataDifference, Structure, StructureData,
93    StructureDifference, StructureDifferenceOptions, StructureView, ValueDifference,
94    structure_difference,
95};
96pub use symbol::{AltId, DictionaryFull, Interner, SymbolId};
97pub use topology::{EntityKind, PolymerKind, Topology};