Struct sixtyfps_compilerlib::object_tree::Element [−][src]
pub struct Element {}Show fields
pub id: String, pub base_type: Type, pub bindings: HashMap<String, BindingExpression>, pub children: Vec<ElementRc>, pub enclosing_component: Weak<Component>, pub property_declarations: HashMap<String, PropertyDeclaration>, pub named_references: NamedReferenceContainer, pub property_animations: HashMap<String, PropertyAnimation>, pub repeated: Option<RepeatedElementInfo>, pub states: Vec<State>, pub transitions: Vec<Transition>, pub child_of_layout: bool, pub is_flickable_viewport: bool, pub item_index: OnceCell<usize>, pub node: Option<Element>,
An Element is an instentation 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: Type
bindings: HashMap<String, BindingExpression>
Currently contains also the callbacks. FIXME: should that be changed?
children: Vec<ElementRc>
enclosing_component: Weak<Component>
The component which contains this element.
property_declarations: HashMap<String, PropertyDeclaration>
named_references: NamedReferenceContainer
Main owner for a reference to a property.
property_animations: HashMap<String, PropertyAnimation>
repeated: Option<RepeatedElementInfo>
Tis element is part of a `for
states: Vec<State>
transitions: Vec<Transition>
child_of_layout: bool
true when this item’s geometry is handled by a layout
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
impl Element
[src]
impl Element
[src]pub fn from_node(
node: Element,
id: String,
parent_type: Type,
component_child_insertion_point: &mut Option<(ElementRc, ChildrenPlaceholder)>,
diag: &mut BuildDiagnostics,
tr: &TypeRegister
) -> ElementRc
[src]
node: Element,
id: String,
parent_type: Type,
component_child_insertion_point: &mut Option<(ElementRc, ChildrenPlaceholder)>,
diag: &mut BuildDiagnostics,
tr: &TypeRegister
) -> ElementRc
pub fn lookup_property<'a>(&self, name: &'a str) -> PropertyLookupResult<'a>
[src]
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.
pub fn span(&self) -> Span
[src]
Return the Span of this element in the AST for error reporting
pub fn native_class(&self) -> Option<Rc<NativeClass>>
[src]
pub fn builtin_type(&self) -> Option<Rc<BuiltinElement>>
[src]
Trait Implementations
impl Spanned for Element
[src]
impl Spanned for Element
[src]fn span(&self) -> Span
[src]
fn source_file(&self) -> Option<&SourceFile>
[src]
fn to_source_location(&self) -> SourceLocation
[src]
Auto Trait Implementations
impl !RefUnwindSafe for Element
impl !RefUnwindSafe for Element
impl !UnwindSafe for Element
impl !UnwindSafe for Element