pub struct ContainerDef {
pub id: DefinitionId,
pub scope_id: DefinitionId,
pub name: Option<NameId>,
pub bytecode: Vec<u8>,
pub counting_flags: CountingFlags,
pub path_hash: i32,
pub param_count: u8,
pub params: Vec<ParamMeta>,
pub local: bool,
}Expand description
A compiled container (knot, stitch, gather, or anonymous flow block).
Fields§
§id: DefinitionId§scope_id: DefinitionIdThe lexical scope this container belongs to.
For scope containers (root, knot, stitch): scope_id == id.
For child containers (gather, choice target, sequence, etc.): scope_id is
the enclosing scope’s DefinitionId.
name: Option<NameId>Human-readable name for scope-owning containers (root, knot, stitch).
None for child containers.
bytecode: Vec<u8>§counting_flags: CountingFlags§path_hash: i32Sum of char values from the container’s ink path string. Used to seed the RNG for shuffle sequences.
param_count: u8Number of parameters this container declares (a parameterized knot,
stitch, or function — e.g. === call(action, present) === has 2). The
container’s prologue binds them with that many leading DeclareTemps.
0 for the vast majority of containers. Lets the runtime arity-check a
host-directed entry (choose_path_string_with_args) or call_function.
The converter reference pipeline leaves this 0 (inklecate’s JSON does
not expose it); only the brink compiler populates the true count.
params: Vec<ParamMeta>Per-parameter name and mode metadata, in declared order (T1c,
docs/t1c-spec.md §6). Empty for the vast majority of containers.
Carried so the runtime can validate a rehydrated function value
against the current signature: a #fn/closure saved before a
recompile stores its bound params’ names and modes, and on load/invoke
they are checked against this table — a renamed or re-moded param is a
defined fault, never a silent misbinding (spec §6). len() always
equals param_count; both are kept (the count is
the pre-T1c arity-check field, the metadata is additive). The converter
reference pipeline leaves this empty.
local: boolCompiled scope default: true for a flow-private (#@local) knot or
stitch. Only ever set on scope-owning containers; subtree coverage of
interior containers is resolved by the runtime at policy resolution
(docs/directive-annotations-spec.md). The converter always emits
false (inklecate has no flow-private concept).
Trait Implementations§
Source§impl Clone for ContainerDef
impl Clone for ContainerDef
Source§fn clone(&self) -> ContainerDef
fn clone(&self) -> ContainerDef
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more