Struct sixtyfps_compilerlib::object_tree::Component[][src]

pub struct Component {
    pub id: String,
    pub root_element: ElementRc,
    pub parent_element: Weak<RefCell<Element>>,
    pub optimized_elements: RefCell<Vec<ElementRc>>,
    pub embedded_file_resources: RefCell<HashMap<String, usize>>,
    pub root_constraints: RefCell<LayoutConstraints>,
    pub child_insertion_point: RefCell<Option<(ElementRc, ChildrenPlaceholder)>>,
    pub setup_code: RefCell<Vec<Expression>>,
    pub used_types: RefCell<UsedSubTypes>,
    pub popup_windows: RefCell<Vec<PopupWindow>>,
    pub exported_global_names: RefCell<Vec<String>>,
}
Expand description

A component is a type in the language which can be instantiated, Or is materialized for repeated expression.

Fields

id: Stringroot_element: ElementRcparent_element: Weak<RefCell<Element>>

The parent element within the parent component if this component represents a repeated element

optimized_elements: RefCell<Vec<ElementRc>>

List of elements that are not attached to the root anymore because they have been optimized away, but their properties may still be in use

embedded_file_resources: RefCell<HashMap<String, usize>>

Map of resources that should be embedded in the generated code, indexed by their absolute path on disk on the build system and valued by a unique integer id, that can be used by the generator for symbol generation.

root_constraints: RefCell<LayoutConstraints>

The layout constraints of the root item

child_insertion_point: RefCell<Option<(ElementRc, ChildrenPlaceholder)>>

When creating this component and inserting “children”, append them to the children of the element pointer to by this field.

setup_code: RefCell<Vec<Expression>>

Code to be inserted into the constructor

used_types: RefCell<UsedSubTypes>

The list of used extra types used (recursively) by this root component. (This only make sense on the root component)

popup_windows: RefCell<Vec<PopupWindow>>exported_global_names: RefCell<Vec<String>>

The names under which this component should be accessible if it is a global singleton and exported.

Implementations

This component is a global component introduced with the “global” keyword

Returns true if use/instantiation of this component requires generating code in Rust/C++/etc..

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.