pax-manifest
Submodules
Structs
ComponentDefinition
Container for an entire component definition — includes template, settings, event bindings, property definitions, and compiler + reflection metadata
Properties
type_id
Type: TypeId
is_main_component
Type: bool
is_primitive
Type: bool
is_struct_only_component
Type: bool
Flag describing whether this component definition is a "struct-only component", a
struct decorated with #[pax] for use as the T in Property<T>.
module_path
Type: String
primitive_instance_import_path
Type: Option<String>
For primitives like Rectangle or Group, a separate import path is required for the Instance (render context) struct and the Definition struct. For primitives, then, we need to store an additional import path to use when instantiating.
template
Type: Option<ComponentTemplate>
settings
Type: Option<Vec<SettingsBlockElement>>
timelines
Type: Vec<TimelineDefinition>
route_branch
Type: Option<RouteBranchDescriptor>
ComponentTemplate
Implementations
from_parts
pub fn from_parts(containing_component: TypeId, root: VecDeque<TemplateNodeId>, children: HashMap<TemplateNodeId, VecDeque<TemplateNodeId>>, nodes: HashMap<TemplateNodeId, TemplateNodeDefinition>, next_id: usize, template_source_file_path: Option<String>) -> Self
Construct a component template from already-materialized storage.
ControlFlowRouteBranchDefinition
Properties
metadata
Type: Option<RouteMetadataDefinition>
Compiler-only document metadata attached to this declarative route.
The web compiler consumes this before cartridge generation. Runtime routing and baked program representations intentionally omit it.
ExpressionCompilationInfo
Properties
dependencies
Type: Vec<String>
symbols used in the expression
GradientDefinition
Compile-time representation of an inline @gradient value.
Properties
shape
Type: GradientShapeDefinition
elements
Type: Vec<GradientElement>
Implementations
stops
pub fn stops(&self) -> impl Iterator
Iterate only stop entries, skipping comments.
GradientStopDefinition
A single color stop in a gradient ramp.
Properties
position
Type: Size
color
Type: ValueDefinition
HostCrateInfo
Pulled from host Cargo.toml
Properties
name
Type: String
for example: pax-example
identifier
Type: String
for example: pax_example
import_prefix
Type: String
for example: some_crate::pax_reexports,
LiteralBlockDefinition
Container for a parsed Literal object
Properties
explicit_type_pascal_identifier
Type: Option<Token>
elements
Type: Vec<SettingElement>
Implementations
new
pub fn new(elements: Vec<SettingElement>) -> Self
Construct a literal object block from setting elements.
get_all_settings
pub fn get_all_settings<'a>(&'a self) -> Vec<(&'a Token, &'a ValueDefinition)>
Return only actual setting entries, omitting comments.
LocationInfo
Container for holding metadata about original Location in Pax Template Used for source-mapping
Properties
start_line_col
Type: (usize, usize)
end_line_col
Type: (usize, usize)
NodeLocation
Full editable location metadata for a template node.
Properties
type_id
Type: TypeId
tree_location
Type: TreeLocation
index
Type: TreeIndexPosition
Implementations
get_tree_location
pub fn get_tree_location(&self) -> &TreeLocation
Parent-location component of this node location.
get_type_id
pub fn get_type_id(&self) -> &TypeId
Type id of the node at this location.
new
pub fn new(type_id: TypeId, location: TreeLocation, index: TreeIndexPosition) -> Self
Construct a node location.
PaxManifest
Definition container for an entire Pax cartridge
Properties
components
Type: BTreeMap<TypeId, ComponentDefinition>
main_component_type_id
Type: TypeId
type_table
Type: TypeTable
assets_dirs
Type: Vec<String>
Compiler metadata: list of fully qualified asset directories, gathered during compiletime, from which assets will be copied for bundling into executable binaries
engine_import_path
Type: String
Compiler metadata: the import prefix for the engine module, pax_kit::pax_engine by default,
but parameterizable for crates such as pax-std that integrate with pax-engine directly.
PropertyDefinition
Properties
name
Type: String
String representation of the symbolic identifier of a declared Property
flags
Type: PropertyDefinitionFlags
Flags, used ultimately by ExpressionSpecInvocations, to denote
e.g. whether a property is the i or elem of a Repeat, which allows
for special-handling the RIL that invokes these values
type_id
Type: TypeId
Statically known type_id for this Property's associated TypeDefinition
Implementations
Describes static metadata surrounding a property, for example
the string representation of the property's name and a TypeInfo
entry for the property's statically discovered type
primitive_with_name
pub fn primitive_with_name(type_name: &str, symbol_name: &str) -> Self
Shorthand factory / constructor
PropertyDefinitionFlags
These flags describe the aspects of properties that affect RIL codegen. Properties are divided into modal axes (exactly one value should be true per axis per struct instance) Codegen considers each element of the cartesian product of these axes
Properties
is_binding_repeat_i
Type: bool
Does this property represent the index i in for (elem, i) ?
is_binding_repeat_elem
Type: bool
Does this property represent elem in for (elem, i) OR for elem in 0..5 ?
is_repeat_source_range
Type: bool
Is the source being iterated over a Range?
is_repeat_source_iterable
Type: bool
Is the source being iterated over an iterable, like Vec<T>?
is_property_wrapped
Type: bool
Describes whether this property is a Property-wrapped T in Property<T>
This distinction affects our ability to dirty-watch a particular property, and
has implications on codegen
is_enum
Type: bool
Describes whether this property is an enum variant property
RouteBranchDescriptor
Compile-time contract allowing a component or primitive to act as a direct
route branch child of Router.
Properties
path_property
Type: String
default_property
Type: String
modal
Type: bool
SettingsConditionalBlock
Top-level conditional content inside a settings block.
Properties
branches
Type: Vec<SettingsConditionalBranch>
SettingsConditionalBranch
One branch inside a settings conditional. None represents else.
Properties
condition_expression
Type: Option<ExpressionInfo>
elements
Type: Vec<SettingsBlockElement>
TemplateNodeDefinition
Represents an entry within a component template, e.g. a <Rectangle> declaration inside a template
Each node in a template is represented by exactly one TemplateNodeDefinition, and this is a compile-time
concern. Note the difference between compile-time definitions and runtime instances.
A compile-time TemplateNodeDefinition corresponds to a single runtime RenderNode instance.
Properties
type_id
Type: TypeId
Reference to the unique string ID for a component, e.g. primitive::Frame or component::Stacker
control_flow_settings
Type: Option<ControlFlowSettingsDefinition>
Iff this TND is a control-flow node: parsed control flow attributes (slot/if/for)
settings
Type: Option<Vec<SettingElement>>
IFF this TND is NOT a control-flow node: parsed key-value store of attribute definitions (like some_key="some_value")
selector_info
Type: TemplateNodeSelectorInfo
Normalized selector metadata preserved for runtime/designtime matching.
raw_comment_string
Type: Option<String>
IFF this TND is a comment node: raw comment string
TemplateNodeId
Stable id for a template node inside a single component.
Implementations
as_usize
pub fn as_usize(&self) -> usize
Numeric index backing this id.
build
pub fn build(id: usize) -> Self
Construct a template node id from its numeric index.
TimelineDefinition
Compile-time representation of a declared timeline.
Properties
name
Type: Option<Token>
playhead
Type: Option<ValueDefinition>
duration
Type: Option<ValueDefinition>
repeat
Type: bool
interruption
Type: InOutInterruption
elements
Type: Vec<TimelineBlockElement>
TimelineKeyframe
A single timeline value at a frame, duration, or percent marker.
Properties
marker
Type: TimelineMarker
value
Type: ValueDefinition
easing
Type: Option<Token>
TimelineSelectorBlockDefinition
Selector body inside a timeline block.
Properties
elements
Type: Vec<TimelineSelectorElement>
TimelineTrackDefinition
Track-level timeline data for one animated property.
Properties
elements
Type: Vec<TimelineTrackElement>
playhead
Type: Option<Box<ValueDefinition>>
duration
Type: Option<Box<ValueDefinition>>
repeat
Type: Option<bool>
starting_value
Type: Option<Box<ValueDefinition>>
interruption
Type: InOutInterruption
use_local_property_scope
Type: bool
Implementations
keyframes
pub fn keyframes(&self) -> impl Iterator
Iterate only keyframe entries, skipping comments.
Token
Container for parsed values with optional location information Location is optional in case this token was generated dynamically
Properties
token_value
Type: String
token_location
Type: Option<LocationInfo>
Implementations
new
pub fn new(token_value: String, token_location: LocationInfo) -> Self
Construct a token with source location information.
new_without_location
pub fn new_without_location(token_value: String) -> Self
Construct a token synthesized without a source location.
TransitionDefinition
Pair of timeline tracks bound to a node's enter/exit lifecycle.
Properties
enter
Type: Option<TimelineTrackDefinition>
exit
Type: Option<TimelineTrackDefinition>
starting_value
Type: Option<Box<ValueDefinition>>
TypeDefinition
Describes metadata surrounding a property's type, gathered from a combination of static & dynamic analysis
Properties
type_id
Type: TypeId
Program-unique ID for this type
inner_iterable_type_id
Type: Option<TypeId>
Statically known type_id for this Property's iterable TypeDefinition, that is,
T for some Property<Vec<T>>
property_definitions
Type: Vec<PropertyDefinition>
A vec of PropertyType, describing known addressable (sub-)properties of this PropertyType
Implementations
builtin_vec_rc_ref_cell_any_properties
pub fn builtin_vec_rc_ref_cell_any_properties(inner_iterable_type_id: TypeId) -> Self
Used by Repeat for source expressions, e.g. the self.some_vec in for elem in self.some_vec
TypeId
Implementations
build_blank_component
pub fn build_blank_component(pascal_identifier: &str) -> Self
Build a typeid for a transient component
build_map
pub fn build_map(key_identifier: &str, value_identifier: &str) -> Self
Build a TypeId for map types like std::collections::HashMap<String><Color>
build_option
pub fn build_option(identifier: &str) -> Self
Build a TypeId for option types like std::option::Option<Color>
build_primitive
pub fn build_primitive(identifier: &str) -> Self
Build a TypeId for rust primitives like u8 or String
build_range
pub fn build_range(identifier: &str) -> Self
Build a TypeId for range types like std::ops::Range<Color>
build_singleton
pub fn build_singleton(import_path: &str, pascal_identifier: Option<&str>) -> Self
Build a TypeId for a most types, like Stacker or SpecialComponent
build_vector
pub fn build_vector(elem_identifier: &str) -> Self
Build a TypeId for vector types like Vec<Color>
UniqueTemplateNodeIdentifier
Globally unique identity for a template node: component type plus local template-node id.
Implementations
build
pub fn build(component: TypeId, template_node_id: TemplateNodeId) -> Self
Construct a globally unique template-node id.
get_containing_component_type_id
pub fn get_containing_component_type_id(&self) -> TypeId
Component that owns this template node.
get_template_node_id
pub fn get_template_node_id(&self) -> TemplateNodeId
Node id within the containing component template.
Enums
ControlFlowConditionalBranchKind
Container for storing parsed control flow information, for example the string (PAXEL) representations of condition / slot / repeat expressions and the related vtable ids (for "punching" during expression compilation)
Variants
If
ElseIf
Else
ControlFlowRepeatPredicateDefinition
Container for holding parsed data describing a Repeat (for)
predicate, for example the (elem, i) in for (elem, i) in foo or
the elem in for elem in foo
Variants
ElemId(String)
ElemIdIndexId(String, String)
GradientElement
One entry inside a gradient block.
Variants
Stop(GradientStopDefinition)
Comment(String)
GradientShapeDefinition
Shape-specific parameters for a gradient. V1 maps directly to runtime Fill variants.
Variants
Linear { start: Option<Box<ValueDefinition>>, end: Option<Box<ValueDefinition>> }
Radial { start: Box<ValueDefinition>, end: Box<ValueDefinition>, radius: Box<ValueDefinition> }
InOutInterruption
Controls how an @in or @out timeline begins when it directly reverses
the other lifecycle transition on the same mounted instance.
Variants
Takeover
Continue from the property's currently sampled value.
Restart
Begin from the destination timeline's authored starting value.
Number
Parsed numeric literal before final type coercion.
Variants
Float(f64)
Int(isize)
PaxType
Manifest-level type identity category.
Variants
If
Router
Slot
Repeat
Comment
BlankComponent
Primitive
Singleton
Range
Option
Vector
Map
Unknown
SettingElement
One key/value or comment entry inside a literal block.
Variants
Setting(Token, ValueDefinition)
Comment(String)
SettingsBlockElement
One entry inside a settings block.
Variants
SelectorBlock(Token, LiteralBlockDefinition)
Handler(Token, Vec<Token>)
Transition(Token, Token)
Conditional(SettingsConditionalBlock)
Comment(String)
TimelineBlockElement
One entry inside a timeline block.
Variants
SelectorBlock(Token, TimelineSelectorBlockDefinition)
Comment(String)
TimelineMarker
Timeline position expressed as an absolute frame, absolute duration, or normalized percentage.
Variants
Frame(u64)
Duration(Duration)
Percent(f64)
TimelineSelectorElement
One selector-scoped element inside a timeline block.
Variants
Track(Token, TimelineTrackDefinition)
Comment(String)
TimelineTrackElement
One entry in a timeline track.
Variants
Keyframe(TimelineKeyframe)
Comment(String)
TreeIndexPosition
Desired insertion position among siblings.
Variants
Top
Bottom
At(usize)
Implementations
get_index
pub fn get_index(&self, len: usize) -> usize
Resolve this symbolic position against a sibling-list length.
new
pub fn new(index: usize) -> Self
Construct an explicit index position.
TreeLocation
Parent relationship for a node inside a component template tree.
Variants
Root
Parent(TemplateNodeId)
Unit
Parsed Pax unit suffix.
Variants
Pixels
Percent
ValueDefinition
Container for settings values, storing all possible variants, populated at parse-time and used at compile-time
Variants
Undefined
LiteralValue(PaxValue)
Block(LiteralBlockDefinition)
Timeline(TimelineTrackDefinition)
Gradient(GradientDefinition)
Transition(TransitionDefinition)
Expression(ExpressionInfo)
(Expression contents, vtable id binding)
Identifier(PaxIdentifier)
(Expression contents, vtable id binding)
DoubleBinding(PaxIdentifier)
(Expression contents, vtable id binding)
EventBindingTarget(PaxIdentifier)
Functions
escape_identifier
pub fn escape_identifier(input: String) -> String
Mangle an identifier into a token-safe representation for generated symbols.
get_common_properties_as_property_definitions
pub fn get_common_properties_as_property_definitions() -> Vec<PropertyDefinition>
Common properties represented as manifest property definitions.
get_common_properties_type_ids
pub fn get_common_properties_type_ids() -> Vec<TypeId>
Type ids for the built-in common properties attached to every template node.
Constants
SUPPORTED_NONNUMERIC_PRIMITIVES
Primitive nonnumeric Rust types supported directly by manifest reflection.
SUPPORTED_NUMERIC_PRIMITIVES
Primitive numeric Rust types supported directly by manifest reflection.