Skip to main content

StoryData

Struct StoryData 

Source
pub struct StoryData {
Show 19 fields pub containers: Vec<ContainerDef>, pub line_tables: Vec<ScopeLineTable>, pub variables: Vec<GlobalVarDef>, pub list_defs: Vec<ListDef>, pub list_items: Vec<ListItemDef>, pub externals: Vec<ExternalFnDef>, pub addresses: Vec<AddressDef>, pub address_paths: Vec<AddressPath>, pub name_table: Vec<String>, pub list_literals: Vec<ListValue>, pub literal_pool: Vec<Value>, pub struct_shapes: Vec<StructShapeDef>, pub private_defs: Vec<DefinitionId>, pub alias_table: Vec<AliasEntry>, pub effect_rows: Vec<EffectRowEntry>, pub frame_shapes: Vec<FrameShapeDef>, pub debug_info: Option<DebugInfoSection>, pub line_variant_groups: Vec<LineVariantGroup>, pub source_checksum: u32,
}
Expand description

The top-level compiled story: everything the runtime needs to execute.

Fields§

§containers: Vec<ContainerDef>§line_tables: Vec<ScopeLineTable>

Per-scope line tables. Each scope (root, knot, stitch) gets one table shared by all containers within that scope.

§variables: Vec<GlobalVarDef>§list_defs: Vec<ListDef>§list_items: Vec<ListItemDef>§externals: Vec<ExternalFnDef>§addresses: Vec<AddressDef>

Address definitions mapping IDs to byte offsets within containers.

§address_paths: Vec<AddressPath>

Qualified-path → address-target table. The single source of truth for Program::find_address; empty for legacy/converter output (the linker then falls back to deriving scope paths from container names).

§name_table: Vec<String>

Interned name strings, indexed by NameId.

§list_literals: Vec<ListValue>

List literal values referenced by PushList(idx) opcodes.

§literal_pool: Vec<Value>

The T1b LiteralPool (docs/format-v4-rfc.md §2): content-hash deduplicated constant values referenced by PushLiteral(idx) opcodes. Distinct from list_literals/PushList — this is additive new surface for T1b collection literals, not a replacement (the RFC’s ListLiterals absorption is a separate, larger migration; see the T1b-2 PR description).

§struct_shapes: Vec<StructShapeDef>

The TM-4 StructShapes table (docs/format-spec.md section tag 0x0C): one entry per declared STRUCT, indexed by crate::value::ShapeId. Referenced by RecordNew/static RecordGet/RecordSet opcodes and by Value::Record values in the literal pool, globals, and the transcript.

§private_defs: Vec<DefinitionId>

DefinitionIds of every #@private definition (M-2b, docs/modules-spec.md §4 boundary rule 2). Sorted ascending by raw id for determinism. Empty for the entire pre-modules / all-public world, in which case the .inkb Visibility section (tag 0x0E) is omitted entirely — so public-only stories stay byte-identical.

This is the complement encoding: public is the default, private names are enumerated (mirroring how #@local scope defaults are carried). The runtime builds a lookup set from it and refuses host semantic access (variable get/set, entry lookup, function eval) to these defs; host persistence (save/load/journal/replay) ignores it and sees everything (§4 boundary rule 2).

§alias_table: Vec<AliasEntry>

The M-3 AliasTable (docs/modules-spec.md §5, format section tag 0x0F): old→new DefinitionId rename records emitted from #@was(old_name) directives on modules and definitions. Sorted by old for the runtime’s binary-search miss-path lookup. Empty for every story that uses no #@was — including the entire pre-M-3 corpus and converter output.

§effect_rows: Vec<EffectRowEntry>

The T2-3 EffectRows table (docs/effects-spec.md §11, format section tag 0x0D): one factored effect row per knot/stitch — the host’s resume-scheduling estimate (§12.1). Additive metadata: the runtime does not consume rows yet (sleep/narrowing are the future clients), so a story that carries rows runs byte-identically to one that does not. Empty for converter output and any story compiled before this slice. Sorted by def (ascending raw id) for determinism.

§frame_shapes: Vec<FrameShapeDef>

The FS-3 FrameShapes table (docs/flow-suspension-spec.md §4/§11, .inkb section tag 0x10): one FrameShapeDef per await site — the name-keyed static description of which locals cross the park, so the runtime knows what to spill/restore around a suspension. Sorted by site (ascending raw id) for determinism.

Reserved-through-fence: additive metadata the runtime does not consume yet, and — because the E052 await lowering fence stands (FS-3c) — never populated by compilation today. Empty for every story compiled today and all converter output, so a story carrying frame shapes runs byte-identically to one without. First emission rides the continuation-splitting codegen when the fence drops (FS-3r). The section is omitted entirely from .inkb when empty (self-framed in the offset table, like Visibility), so existing stories stay byte-identical.

§debug_info: Option<DebugInfoSection>

D6 DebugInfo (docs/debugger-spec.md §2, .inkb tag 0x11): bytecode-offset → source-range map. None when debug info was not requested at compile time — the ship-policy default (§1.2): a release-exported story never carries this, so the section is omitted entirely from .inkb and every existing byte stays identical to before this field existed. Some only for a dev/studio compile or an explicit CLI debug flag.

§line_variant_groups: Vec<LineVariantGroup>

Line-variant groups (stage 1 of the shared-alternatives track, issue #3273): records tying runs of consecutive line-table entries back to one authored line whose inline alternatives were enumerated at recognition time. Empty until the stage-2 flip routes lines here; the .inkb section (tag 0x12) is omitted entirely when empty, so every story without variant groups stays byte-identical.

§source_checksum: u32

CRC-32 checksum from the .inkb header, used for locale validation. Zero for stories not loaded from .inkb.

Trait Implementations§

Source§

impl Clone for StoryData

Source§

fn clone(&self) -> StoryData

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StoryData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for StoryData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for StoryData

Source§

fn eq(&self, other: &StoryData) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for StoryData

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.