Skip to main content

appcore_filemaker/
lib.rs

1// =============================================================================
2//        #######
3//     ###       ###     F: lib.rs
4//    ##   ## ##   ##    P: AppCore-Runtime
5//         ## ##
6//                       C: 2026/08/30 05:00:00 by dnettoRaw
7//    ##   ## ##   ##    U: 2026/08/30 05:00:00 by dnettoRaw
8//      ###########      S: 1.0.2-rc
9// =============================================================================
10
11//! Deterministic declarative document, canvas, and dataset compiler.
12
13/// Explicit sandboxed asset and template resolvers.
14pub mod asset;
15/// Native deterministic EAN-13 encoding and geometry.
16pub mod barcode;
17mod binding_style;
18/// Bounded compile-once/render-many caches.
19pub mod cache;
20/// Geometry-first collision policies and deterministic spatial index.
21pub mod collision;
22/// Parse, include expansion, component expansion, and binding pipeline.
23pub mod compiler;
24mod compiler_bind;
25mod compiler_style;
26/// Minimum, preferred, maximum, aspect, and alignment contracts.
27pub mod constraints;
28/// Cooperative cancellation and progress contracts.
29pub mod control;
30/// Typed deterministic data values and schemas.
31pub mod data;
32/// Read-only debug overlays and geometry-derived collision masks.
33pub mod debug;
34/// JSON/vector/raster export for geometry-derived debug masks.
35pub mod debug_export;
36mod debug_geometry;
37mod debug_plan;
38#[cfg(test)]
39mod debug_tests;
40mod diagnostic_budget;
41/// Typed errors and stable FM codes.
42pub mod error;
43/// Capability-declared exporters selected only at call time.
44pub mod export;
45/// Bounded deterministic expression evaluation.
46pub mod expression;
47/// Deterministic input fingerprints.
48pub mod fingerprint;
49/// Explicit deterministic font registry.
50pub mod font;
51/// Fixed-point geometry contracts.
52pub mod geometry;
53/// Image crop, fit, focal point, EXIF, and resolved paint geometry.
54pub mod image;
55/// Read-only scene inspection and free-region queries.
56pub mod inspect;
57/// Format-neutral intermediate representations.
58pub mod ir;
59mod ir_validation;
60/// Measurement, layout, pagination, and bounded reflow engine.
61pub mod layout;
62mod layout_collision;
63mod layout_context;
64mod layout_exclusion;
65mod layout_flow;
66mod layout_fragments;
67mod layout_geometry;
68mod layout_keep;
69mod layout_measure;
70mod layout_page;
71mod layout_placement;
72mod layout_policy;
73mod layout_region;
74/// Bounded anti-overflow and resolved-scene safety audits.
75pub mod layout_safety;
76mod layout_table;
77mod layout_table_stream;
78#[cfg(test)]
79mod layout_table_tests;
80/// Resource budgets.
81pub mod limits;
82mod memory;
83/// Page roles, masters, margins, bleed, safe areas, and numbering.
84pub mod page;
85/// Runtime mutation and transactional patch application.
86pub mod patch;
87mod patch_log;
88/// Versioned page and canvas presets.
89pub mod preset;
90pub mod qrcode;
91/// Fully resolved exporter-facing scene.
92pub mod resolved;
93mod resolved_table;
94/// Strict version-one YAML frontend types.
95pub mod source;
96mod source_build;
97mod source_element;
98mod source_elements;
99mod source_layout;
100mod source_page;
101mod source_page_build;
102mod source_style;
103mod source_table;
104mod source_text;
105mod source_transform;
106/// Colors, themes, and style cascade contracts.
107pub mod style;
108/// First-class bounded and streaming datasets/tables.
109pub mod table;
110mod table_columns;
111mod table_group_pagination;
112/// Unicode, `BiDi`, shaping, line breaking, and measurement.
113pub mod text;
114#[cfg(test)]
115mod text_break_tests;
116mod text_padding;
117mod text_pagination;
118mod text_shaping;
119mod transform_math;
120/// Fixed-point units and source lengths.
121pub mod units;
122/// Schema, binding, layout, and exporter-aware preflight.
123pub mod validation;
124mod validation_capability;
125mod validation_data;
126mod validation_layout;
127mod validation_page;
128mod validation_table;
129
130pub use asset::{Asset, AssetResolver, FileResolver, MemoryResolver, TemplateResolver};
131pub use cache::SceneCache;
132pub use collision::{
133    CollisionBounds, CollisionPolicy, CollisionResolution, CollisionRule, LinearSpatialIndex,
134    SpatialIndex,
135};
136pub use compiler::{Compiler, CompilerBuilder};
137pub use constraints::{Alignment, Distribution, LayoutConstraints};
138pub use control::{
139    CancellationToken, OperationControl, ProgressEvent, ProgressObserver, ProgressPhase,
140};
141pub use data::{
142    resolve_computed_fields, CurrencyValue, DataField, DataSchema, DataType, DataValue,
143};
144pub use debug::{CollisionMask, DebugOverlay, DebugOverlayOptions, DebugPrimitive, MaskView};
145pub use debug_export::{export_collision_mask, MaskFormat};
146pub use error::{ErrorCode, FileMakerError, Result};
147pub use export::{
148    export, export_bytes, export_controlled, export_dataset_csv, export_dataset_csv_bytes,
149    export_dataset_csv_controlled, export_raster_controlled, ExportCapabilities, ExportContext,
150    ExportFormat, ExportLoss, ExportLossKind, ExportLossReport, ExportOutcome, ExportRequest,
151    ExportStyleOverride, Fidelity, HtmlMode, PdfMode, RasterOptions,
152};
153pub use expression::{Expression, ExpressionBudget};
154pub use fingerprint::{DocumentFingerprint, FingerprintBuilder};
155pub use font::{FontAsset, FontManager, FontResolver, FontSubset, PdfStandardFont};
156pub use geometry::{BoundsSet, Insets, PathCommand, Point, Rect, Shape, Size, Transform};
157pub use image::{
158    resolve_image_placement, ImageCrop, ImageFit, ImageOptions, ImageOrientation, ImagePlacement,
159    PixelRect,
160};
161pub use inspect::{ElementInspection, LayoutExplanation, PageInspection, SceneInspector};
162pub use ir::{
163    AiPolicy, DocumentIr, ElementId, ElementIr, ElementKind, ExclusionIr, GeometryIr, LayoutMode,
164    PathCommandIr, Provenance, RegionIr, TableIr, TablePageBodies, TablePageBody, TemplateIr,
165    TextIr, TextSegmentIr, TransformIr,
166};
167pub use layout::{LayoutEngine, LayoutOptions};
168pub use layout_safety::{audit_layout, LayoutSafetyOptions, LayoutSafetyReport};
169pub use limits::ResourceLimits;
170pub use page::{PageBand, PagePlacement, PageRole, PageTemplate, PageTemplateSet};
171pub use patch::{Patch, PatchOperation, PatchTransaction};
172pub use patch_log::OperationLog;
173pub use preset::{Orientation, Preset, PresetRegistry};
174pub use resolved::{
175    LayoutTrace, ResolvedElement, ResolvedExclusion, ResolvedPage, ResolvedRegion, ResolvedScene,
176};
177pub use resolved_table::{ResolvedTableCell, ResolvedTableFragment, ResolvedTableRow};
178pub use source::{
179    ColorSource, EdgeSource, ElementSource, ElementStyleRuleSource, ExclusionSource, MirrorSource,
180    ModelKind, PageLayerSource, PageSource, TableSource, TableStyleRuleSource, TemplateSourceV1,
181    TextSegmentSource, TextSourceOptions, TransformSource,
182};
183pub use style::{Color, ComputedStyle, ElementStyleRule, StrokeSides, Style, StyleCascade};
184pub use table::{
185    BorrowedDataset, CellPadding, ColumnWidth, DataRow, Dataset, InMemoryDataset, StreamingDataset,
186    TableColumn, TablePage, TablePageSink, TablePaginator, TableSpec, TableStyleRule,
187};
188pub use table_columns::{resolve_table_columns, ResolvedTableColumn};
189pub use text::{
190    Glyph, GlyphRun, TextDiagnostic, TextEngine, TextLayout, TextLine, TextOptions, TextOverflow,
191    WritingMode,
192};
193pub use text_padding::TextBlockPadding;
194pub use units::{Length, Unit};
195pub use validation::{
196    preflight, validate_data, validate_layout, validate_template, PreflightOptions, ValidationCode,
197    ValidationIssue, ValidationReport, ValidationSeverity,
198};
199
200/// Source schema accepted by this engine release.
201pub const FILEMAKER_SCHEMA_V1: &str = "1.0";
202
203/// Engine version included in deterministic fingerprints.
204pub const ENGINE_VERSION: &str = env!("CARGO_PKG_VERSION");