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//! - [`numeric`] — the one home of every lossy numeric conversion.
21
22#![forbid(unsafe_code)]
23
24pub mod anisotropy;
25pub mod annotation;
26pub mod bond;
27pub mod chunk;
28pub mod column;
29pub mod contract;
30pub mod coords;
31pub mod diagnostic;
32pub mod element;
33pub mod execution;
34pub mod hashing;
35pub mod index;
36pub mod io;
37pub mod limits;
38pub mod numeric;
39pub mod optional;
40pub mod parallel;
41pub mod provider;
42pub mod secondary;
43pub mod selection;
44pub mod span;
45pub mod structure;
46pub mod symbol;
47pub mod topology;
48
49pub use anisotropy::{AnisotropicDisplacement, AnisotropyTable, AnisotropyTableBuilder};
50pub use annotation::{
51    AROMATIC_ATOM_ANNOTATION, ATOM_RADIUS_ANNOTATION, AUTODOCK_TYPE_ANNOTATION, AnnotationColumn,
52    AtomAnnotation, AtomAnnotations, COMPONENT_KIND_ANNOTATION, FORMAL_CHARGE_ANNOTATION,
53    HBOND_ACCEPTOR_ANNOTATION, HBOND_DONOR_ANNOTATION, INSTANCE_ID_ANNOTATION, MISSING_BAND_CODE,
54    PAE_ANNOTATION, PARTIAL_CHARGE_ANNOTATION, PLDDT_ANNOTATION, POLYMER_ATOM_ROLE_ANNOTATION,
55    PlddtBand, SEGMENT_ID_ANNOTATION, STEREO_CONFIGURATION_ANNOTATION,
56};
57pub use bond::{BondAdjacency, BondOrder, BondProvenance, BondRecord, BondTable, BondTableBuilder};
58pub use chunk::{
59    AtomChunk, AtomChunkStats, ChunkBuilder, ElementMask, Extremes, ParentMapping,
60    TARGET_CHUNK_ATOMS,
61};
62pub use column::{BitVec, EncodedColumn, Presence, ValidityMask};
63pub use contract::{Analysis, AnalysisPolicy, Coverage, Provenance, Status};
64pub use coords::{
65    Aabb, CoordinateBlock, CoordinateGeneration, CoordinateSample, CoordinateSampleError,
66};
67pub use diagnostic::{
68    Class, Code, ContextItem, Diagnostic, Diagnostics, Findings, Kind, Rendered, Severity,
69    Strictness,
70};
71pub use element::Element;
72pub use execution::{
73    Backpressure, Batch, BatchDemand, BatchLease, BatchSource, CancellationToken, Cancelled,
74    ContextError, ExecutionContext, ExecutionContextBuilder, MemoryBudget, MemoryBudgetError,
75    MemoryReservation, ScratchPolicy, SpillArtifact, SpillError, SpillFile, SpillReader,
76    TempStoragePolicy,
77};
78pub use index::{
79    AnisotropyIndex, AtomIndex, BondIndex, ChainIndex, EntityIndex, InstanceId, ModelIndex,
80    ResidueIndex,
81};
82pub use io::{
83    AmbiguousResidueBoundaryPolicy, BatchContinuity, ByteWindow, CategoryFilter, ContinuityLevel,
84    Format, InputBuffer, InputKind, MissingElementPolicy, OccupancyPolicy, ParseMode, ReadOptions,
85    ReadResult, SourceBytes, SpillWindowedFile, StructureAtomRecord, StructureBatch,
86    StructureBatchBuffer, StructureBatchBuilder, StructureBatchError, StructureBatchPool,
87    WindowedFile, WindowedSourceFile, collect_structure, write_output,
88};
89pub use limits::{CapacityError, TableError};
90pub use optional::{OptionalI32, OptionalSymbol};
91pub use provider::{
92    AtomEndpoint, BondChunk, BondChunkProvider, BondChunkRecord, ChunkDescriptor, ChunkId,
93    ChunkLayout, DatasetCatalog, DatasetDescriptor, DatasetId, FrameChunk, FrameChunkProvider,
94    LocalRow, LogicalRow, PayloadKind, PropertyChunk, PropertyChunkProvider, PropertyKind,
95    PropertyValue, ProviderError, StructureChunk, StructureChunkProvider, TARGET_CHUNK_BONDS,
96};
97pub use secondary::{SecondaryAssignment, SecondarySource, SecondaryStructure};
98pub use selection::AtomSelection;
99pub use span::{ByteSpan, Position};
100pub use structure::{
101    CountDifference, DifferenceError, ExtensionStore, MetadataDifference, Structure, StructureData,
102    StructureDifference, StructureDifferenceOptions, StructureView, ValueDifference,
103    structure_difference,
104};
105pub use symbol::{AltId, DictionaryFull, Interner, SymbolId};
106pub use topology::{EntityKind, PolymerKind, Topology};