Skip to main content

Crate dotloom_engine

Crate dotloom_engine 

Source
Expand description

§dotloom-engine

The headless Dotloom engine. It owns the only editable copy of a document and runs every change through one pipeline:

commands → working overlay → structural validation → solve (affected component)
         → independent hard-rule check → atomic commit → revision + events

A failed transaction leaves the document untouched. Undo/redo apply stored before/after states without re-solving. Drags produce transient previews and a single history entry. Plugin entity types are data (EntityTypeDef) compiled from a typed expression language; no host code runs inside the solver.

The engine has no DOM, window or GPU dependency.

Re-exports§

pub use registry::EntityTypeDef;
pub use registry::Registry;
pub use registry::RegistryError;
pub use dotloom_constraints as constraints;
pub use dotloom_document as document;
pub use dotloom_geometry as geometry;
pub use dotloom_scene as scene;

Modules§

eval
Numeric evaluation of entities: world anchors, drawable shapes and texts.
lang
The Dotloom expression language used by plugin model definitions.
registry
Entity type definitions and the type registry (ADR-0006).

Structs§

ApplyOptions
Options of a single request.
CommitReport
Successful commit.
ConstraintPatch
Partial constraint update.
ConstraintSpec
Constraint content (the engine assigns or validates the ID).
DiagnosticReport
A solver diagnostic mapped back to document objects.
DragPreview
Result of a drag update.
Engine
The Dotloom engine.
EngineOptions
Engine configuration.
EntityPatch
Partial update of an entity. props entries set to null remove the property.
Hit
A hit.
LayerPatch
Layer update.
NearestValue
Nearest feasible value for an edit that could not be satisfied.
NewEntity
Data for a new entity.
Overlay
Copy-on-write overlay over a document used while a transaction runs.
ParamValue
A numeric parameter assignment.
SettingsPatch
Settings update.
Snap
A snap result.
SnapOptions
Snap options.
SnapQuery
A snap query.
SolveFailure
Why solving rejected a transaction.
SolverStats
What the solver did for a commit (diagnostics and performance work).
Transaction
A group of commands applied atomically.

Enums§

Command
One command of a transaction.
CommandError
Command errors (the transaction is rejected, nothing changes).
DeletePolicy
What to do with constraints and referencing entities when deleting.
DragSpec
What is dragged.
EditMode
How numeric edits are applied.
EngineError
Engine errors. A failed request never changes the document.
Event
Engine event, emitted after state changes (never during a commit).
PendingState
Progress of a pending commit.
SelectMode
Area selection mode.
SnapKind
Snap kinds in priority order.

Constants§

THEME_DEFAULT
Theme-default color marker.

Traits§

DocView
Read-only view of document content.

Functions§

migrate_entities
Upgrade plugin entities whose type_version is older than the registered definition, applying the definition’s migration steps in order. Entities written by a newer version are left untouched (they evaluate as read-only).