Expand description
Bern’s intermediate representation.
The IR states cross-platform semantics only: no DOM, SwiftUI, GTK or
WinUI types appear here. Every target module consumes the same
Application and decides privately how to realize it.
Modules§
Structs§
- AppInfo
- Application
- Close
Check - The close check of a window. When
whenholds, closing waits for a decision: Save (runningsave), Discard or Cancel. The expressions are evaluated against the closing window’s own session drafts. - Component
Def - Component
Library - Versioned description of a component library crate, generated from its sources. Applications check it against their own configuration before using its components: descriptor and IR versions, the crate version it was generated from, and translations for every required language.
- Component
Ref - Element
- Exemption
- A platform on which a feature need not be reachable, with the reason.
- Expr
- A type-checked restricted expression.
- Feature
Contract - A
#[bern::features]contract: what users can do within the scope of one component, and how each feature is reached in each layout size. - Feature
Def - Field
Ref - A writable session field bound to a control.
- IfLet
Node - IfNode
- Languages
- Layout
Config - Breakpoints choosing between layout sizes, from
[layouts]. - Match
Arm - Match
Binding - Match
Node - Param
Def - Player
Def - An application player from the
#[bern::players]catalog. Its id is the stableplayer_idevery entry uses. - Query
Binding - A query of the engine catalog bound with its arguments. The arguments are restricted expressions; when their values change, the target asks again under a new parameter version and shows only the current answer.
- Resource
Def - A file the application ships with its build, declared in the
[resources]table ofBern.toml. Engines resolve it by name at run time; each target decides where it lives in the product. Neither the contents nor a build machine path are part of the IR. - Session
Def - Typed drafts owned by a UI session, one instance per hosting window.
- Session
Field Def - Size
Coverage - Source
Location - Srgb
- Template
- Theme
- Window
Catalog - Static window kinds declared by the root
WindowSet. The first version supports single-instance windows only. - Window
Def
Enums§
- Action
- Binary
Op - Binding
- Where a binding reads from.
- Component
Arg - Coverage
- Entries found for a feature in one size, by control target.
- Expr
Kind - Feature
Result - The outcome for one feature in one size on one platform.
- Layout
Size - A layout size of
Adaptive. - MediaOp
- A standard media command on an application player.
- Node
- Param
Kind - Presentation
- Prop
- Session
Op - SvgPicture
- How an SVG document shows as a picture of it (
bern_svg::picture). - Text
- Theme
Mode - Window
Chrome - Window
Initial - Window
Op - Window
Role
Constants§
- IR_
VERSION - Version of the IR layout. Targets declare the range they consume.
- LIBRARY_
DESCRIPTOR_ VERSION - Version of the
ComponentLibrarylayout.
Functions§
- holds_
lowered_ list - Whether
nodes, the children of a column, hold a list lowered bylower_lists, directly or in their conditions. - label_
key - Resource key of an enum variant label.
- lazy_
grid_ items - The
ForEachof a grid that, standing in a vertical scroll view, builds only the rows near what is in sight: a grid whose one child is a keyedForEach, not laid out as masonry. Every target builds such a grid lazily; anywhere else it builds all its rows. - leads_
row - Whether
node, followed in a row bynext, is the words that lead the row: a text, or a column standing at its leading edge, before a spacer. It takes the spacer’s room itself, so the controls after it keep their width and the words wrap in what is left, as a list row’s label does. - lower_
lists - A list in a vertical scroll view builds only the rows near what is in
sight: a keyed
ForEachamong the children of aColumnthere (through conditions) becomes a one-column grid of its rows, which every target builds lazily (seelazy_grid_items). The grid keeps the column’s look:alignsays how the rows stand across it,row_gapis the column’sgap(absent when the column has none, for the target’s own), it staggers as the column does, and with no rows it takes no place. A component counts as in a scroll view when every place that shows it is. Columns thatreflowkeep building all their rows, since their rows slide among each other. - lowered_
list_ align - The
aligna list lowered bylower_listskeeps: how its rows stand across it, as in the column it came from. - text_
key - Resource key of a text declared on an element property.