Struct sixtyfps_compilerlib::object_tree::Element[][src]

pub struct Element {
Show 16 fields pub id: String, pub base_type: Type, pub bindings: BindingsMap, pub property_analysis: RefCell<HashMap<String, PropertyAnalysis>>, pub children: Vec<ElementRc>, pub enclosing_component: Weak<Component>, pub property_declarations: BTreeMap<String, PropertyDeclaration>, pub named_references: NamedReferenceContainer, pub repeated: Option<RepeatedElementInfo>, pub states: Vec<State>, pub transitions: Vec<Transition>, pub child_of_layout: bool, pub layout_info_prop: Option<(NamedReference, NamedReference)>, pub is_flickable_viewport: bool, pub item_index: OnceCell<usize>, pub node: Option<Element>,
}
Expand description

An Element is an instantiation of a Component

Fields

id: String

The id as named in the original .60 file.

Note that it can only be used for lookup before inlining. After inlining there can be duplicated id in the component. The id are then re-assigned unique id in the assign_id pass

base_type: Typebindings: BindingsMap

Currently contains also the callbacks. FIXME: should that be changed?

property_analysis: RefCell<HashMap<String, PropertyAnalysis>>children: Vec<ElementRc>enclosing_component: Weak<Component>

The component which contains this element.

property_declarations: BTreeMap<String, PropertyDeclaration>named_references: NamedReferenceContainer

Main owner for a reference to a property.

repeated: Option<RepeatedElementInfo>

Tis element is part of a `for in :

states: Vec<State>transitions: Vec<Transition>child_of_layout: bool

true when this item’s geometry is handled by a layout

layout_info_prop: Option<(NamedReference, NamedReference)>

The property pointing to the layout info. (horizontal, vertical)

is_flickable_viewport: bool

true if this Element is the fake Flickable viewport

item_index: OnceCell<usize>

This is the component-local index of this item in the item tree array. It is generated after the last pass and before the generators run.

node: Option<Element>

The AST node, if available

Implementations

Return the type of a property in this element or its base, along with the final name, in case the provided name points towards a property alias. Type::Invalid is returned if the property does not exist.

Return the Span of this element in the AST for error reporting

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.