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: Typebindings: 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 in :

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]

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]

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 Debug for Element[src]

impl Default for Element[src]

impl Spanned for Element[src]

Auto Trait Implementations

impl !RefUnwindSafe for Element

impl !Send for Element

impl !Sync for Element

impl Unpin for Element

impl !UnwindSafe for Element

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.