Skip to main content

Module transform

Module transform 

Source
Expand description

Reactive transform primitives for derived records

This module provides the .transform() and .transform_join() API for declaring reactive derivations from one or more input records to an output record.

§Transform Archetypes

  • Map (1:1, stateless): Transform each input value to zero-or-one output value
  • Accumulate (N:1, stateful): Aggregate a stream of values with persistent state
  • Join (M×N:1, stateful, multi-input): Combine values from multiple input records

All three are handled by a unified API surface:

  • Single-input: .transform() with TransformBuilder
  • Multi-input: .transform_join() with JoinBuilder

§Design Principles

  • Transforms are owned by AimDB — visible in the dependency graph
  • Transforms are mutually exclusive with .source() on the same record
  • Multiple .tap() observers can still be attached to a transform’s output
  • Input subscriptions use existing Consumer<T, R> / BufferReader<T> API
  • Build-time validation catches missing input keys and cyclic dependencies

Structs§

JoinBuilder
Type-erased input descriptor for joins.
JoinPipeline
Completed multi-input join pipeline, ready to be stored in TypedRecord.
JoinStateBuilder
Intermediate builder for setting the join trigger handler.
StatefulTransformBuilder
Intermediate builder for stateful single-input transforms.
TransformBuilder
Configures a single-input transform pipeline.
TransformPipeline
Completed single-input transform pipeline, ready to be stored in TypedRecord.

Enums§

JoinTrigger
Tells the join handler which input produced a value.