Skip to main content

Module persistent_transformations

Module persistent_transformations 

Source
Expand description

Persistent transformation triggers.

A trigger is a stored LiNo substitution query that the CLI replays after every write, turning a one-off transformation into a standing rule. This is the Rust port of Foundation.Data.Doublets.Cli.PersistentTransformationDecorator, and it keeps the same on-disk shape so the two implementations can read each other’s trigger databases:

(Always ((Condition <condition text>) (Substitution <substitution text>)))
(Once   ((Condition <condition text>) (Substitution <substitution text>)))

Condition, Substitution, Type, Trigger, Once and Always are named points; the condition and substitution texts are named points too, whose names carry the INTERNAL_NAME_PREFIX so they cannot collide with user-visible names.

§Where the triggers live

TriggerStore decides that: TriggerStore::Sidecar keeps them in a companion database (<db>.triggers.links by default, see make_triggers_database_filename), while TriggerStore::Embedded stores them in the decorated database itself — the --embed-triggers mode.

§Extension points

The decorator is generic over any NamedTypeLinks, so it composes with the plain store, the transactions layer and the version-control layer alike, and an embedder can stack it wherever it wants in its own chain. The parsing ( PersistentTransformationQuery), the stored form (PersistentTransformation) and the store selection (TriggerStore) are all public so custom CLIs can inspect, migrate or generate triggers without going through this decorator at all.

Structs§

PersistentTransformation
A trigger as it is stored in a links database.
PersistentTransformationDecorator
Replays stored triggers after every write that goes through it.
PersistentTransformationQuery
A trigger query split into its condition and substitution halves.

Enums§

PersistentTransformationKind
How long a stored trigger lives.
TriggerStore
Where a PersistentTransformationDecorator keeps its triggers.

Constants§

INTERNAL_NAME_PREFIX
Prefix of the internal names used for stored condition and substitution texts. It keeps trigger bookkeeping distinguishable from user names even in TriggerStore::Embedded mode, where both share one namespace.

Functions§

make_triggers_database_filename
Conventional sidecar filename for the trigger store: <db>.triggers.links.