Skip to main content

brink_format/
lib.rs

1//! Binary interface between the brink compiler and runtime.
2//!
3//! This crate defines the types shared across the compiler/runtime boundary:
4//! `DefinitionId`, opcodes, value types, line templates, and the top-level
5//! `StoryData` container.
6//!
7//! `brink-runtime` depends ONLY on this crate — nothing else from brink.
8//!
9//! `no_std` + `alloc`: this crate builds without the standard library when
10//! the default `std` feature is disabled (see `docs/no-std-portability.md`).
11//! `inkt`/`inkt-write` (the `.inkt` text format, used by the intl pipeline)
12//! are not part of the `no_std` surface — `pest` is std-oriented.
13#![cfg_attr(not(feature = "std"), no_std)]
14
15extern crate alloc;
16
17mod codec;
18mod conventions;
19mod counting;
20mod definition;
21mod id;
22mod inkb;
23mod inkl;
24mod line;
25pub mod manifest_field_names;
26mod opcode;
27mod save;
28mod story;
29mod value;
30
31#[cfg(any(feature = "inkt", feature = "inkt-write"))]
32mod inkt;
33
34pub use conventions::{
35    CONVENTIONS_PROJECTION_WIRE_VERSION, ConventionAttachDef, ConventionAttachFieldDef,
36    ConventionEntryDef, ConventionModeDef, ConventionsProjectionDef, SchemaTypeDef,
37    read_conventions_projection, write_conventions_projection,
38};
39pub use counting::CountingFlags;
40pub use definition::{
41    AddressDef, AddressPath, AliasEntry, CallAtom, CapabilityParam, ContainerDef, DirectEffects,
42    DispatchEntry, EffectRowEntry, ExternalFnDef, FrameShapeDef, GlobalVarDef, LineEntry, ListDef,
43    ListItemDef, LocaleData, LocaleLineEntry, LocaleScopeTable, ParamMeta, ScopeLineTable,
44    SlotInfo, SourceLocation, StructShapeDef, content_hash,
45};
46pub use id::{DefinitionId, DefinitionTag, LineId, NameId};
47pub use inkb::{
48    InkbIndex, SectionEntry, SectionKind, assemble_inkb, read_inkb, read_inkb_index,
49    read_section_address_paths, read_section_addresses, read_section_alias_table,
50    read_section_containers, read_section_effect_rows, read_section_externals,
51    read_section_frame_shapes, read_section_line_tables, read_section_list_defs,
52    read_section_list_items, read_section_list_literals, read_section_literal_pool,
53    read_section_name_table, read_section_struct_shapes, read_section_variables,
54    read_section_visibility, write_inkb, write_section_address_paths, write_section_addresses,
55    write_section_alias_table, write_section_containers, write_section_effect_rows,
56    write_section_externals, write_section_frame_shapes, write_section_line_tables,
57    write_section_list_defs, write_section_list_items, write_section_list_literals,
58    write_section_literal_pool, write_section_name_table, write_section_struct_shapes,
59    write_section_variables, write_section_visibility,
60};
61pub use inkl::{read_inkl, write_inkl};
62pub use line::{
63    LineContent, LineFlags, LinePart, LineTemplate, PluralCategory, PluralResolver, SelectKey,
64};
65pub use opcode::{ChoiceFlags, CollectOp, DecodeError, Opcode, SeqVerbOp, SequenceKind, TowerOp};
66pub use save::{
67    LoadReport, SAVE_FORMAT_VERSION, SUSPENDED_FLOW_SECTION_VERSION, SaveState, SuspendedFlow,
68    VisitEntry, WakePolicy, WakeSource,
69};
70pub use story::StoryData;
71pub use value::{
72    ClosureEnvEntry, ClosureValue, ListValue, MAX_DECODE_DEPTH, MapKey, OrderedMap, ProjSegment,
73    ProjectionValue, ShapeId, Value, ValueType, WeightedValue,
74};
75
76#[cfg(any(feature = "inkt", feature = "inkt-write"))]
77pub use inkt::write_inkt;
78#[cfg(feature = "inkt")]
79pub use inkt::{InktParseError, read_inkt};