Skip to main content

Crate forma_ir

Crate forma_ir 

Source
Expand description

Forma Module IR: binary format definitions and parsers.

This crate provides the core IR types and parsing logic that can be compiled to both native Rust and WebAssembly targets.

The wasm feature, which exports render and render_island for the browser’s WASM walker (@getforma/core/wasm), is deprecated since 0.2.2 and is removed in 3.0.0: islands re-render in the browser with @getforma/core’s h(). Both exports still build and work through 0.2.x.

Re-exports§

pub use format::IrError;
pub use format::IrHeader;
pub use format::IslandEntry;
pub use format::IslandTrigger;
pub use format::Opcode;
pub use format::PropsMode;
pub use format::SectionDescriptor;
pub use format::SectionTable;
pub use format::SlotEntry;
pub use format::SlotSource;
pub use format::SlotType;
pub use format::HEADER_SIZE;
pub use format::IR_VERSION;
pub use format::MAGIC;
pub use format::SECTION_TABLE_SIZE;
pub use parser::IrModule;
pub use parser::IslandTableParsed;
pub use parser::SlotTable;
pub use parser::StringTable;
pub use slot::json_to_slot_value;
pub use slot::SlotData;
pub use slot::SlotValue;
pub use walker::walk_island;
pub use walker::walk_island_with_limits;
pub use walker::walk_to_html;
pub use walker::walk_to_html_counted;
pub use walker::walk_to_html_with_limits;
pub use walker::WalkCounts;
pub use walker::WalkFailure;
pub use walker::WalkLimits;
pub use walker::WalkOutput;
pub use walker::DEFAULT_MAX_LIST_ITERATIONS;
pub use walker::DEFAULT_MAX_OUTPUT_BYTES;

Modules§

dump
Human-readable text dump of a module, for debugging and diffing. Human-readable text dump of an IR module for debugging and diffing.
format
On-disk FMIR layout: header, section table, opcodes, and the table entry types. See docs/FMIR-FORMAT.md for the stability contract. FMIR binary format definition and parsers.
parser
Bounds-checked parsing and one-shot structural validation of an FMIR file. Parsers for FMIR data tables: string table, slot table, and island table.
slot
Runtime slot values and the dense SlotData a page handler populates.
walker
The SSR walker: opcode stream plus slot values in, HTML out. Static HTML walker — walks the IR opcode stream to produce HTML output.