TestCell<C extends Cell>.fromRecord constructor
const
TestCell<C extends Cell>.fromRecord (
- dynamic record
Creates a TestCell instance directly from a raw Record blueprint.
This constructor is part of the Flyweight Pattern implementation, allowing the framework to restore validation logic from a compressed state representation. It is primarily used during Structural Deserialization or when moving rules across memory boundaries.
When to use
You rarely need this – it's for internal framework use.
How it works
It directly assigns the provided record to internal storage, bypassing the normal parameter validation. This is a performance optimisation for cases where the record is already known to be valid.
Non‑obvious
- The record's shape is internal; don't rely on it.
- This constructor is used by the
+operator and by deputies to efficiently compose rules.
Implementation
const TestCell.fromRecord(super.record)
: _record = record,
super.fromRecord();