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

pub struct Element {
    pub id: String,
    pub base_type: Type,
    pub bindings: HashMap<String, ExpressionSpanned>,
    pub children: Vec<ElementRc>,
    pub enclosing_component: Weak<Component>,
    pub property_declarations: HashMap<String, PropertyDeclaration>,
    pub property_animations: HashMap<String, ElementRc>,
    pub repeated: Option<RepeatedElementInfo>,
    pub states: Vec<State>,
    pub transitions: Vec<Transition>,
    pub child_of_layout: bool,
    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, ExpressionSpanned>

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

children: Vec<ElementRc>enclosing_component: Weak<Component>

The component which contains this element.

property_declarations: HashMap<String, PropertyDeclaration>property_animations: HashMap<String, ElementRc>repeated: Option<RepeatedElementInfo>

Tis element is part of a `for in :

states: Vec<State>transitions: Vec<Transition>child_of_layout: boolnode: 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>,
    diag: &mut FileDiagnostics,
    tr: &TypeRegister
) -> ElementRc
[src]

pub fn lookup_property(&self, name: &str) -> Type[src]

Return the type of a property in this element or its base

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]

Trait Implementations

impl Debug for Element[src]

impl Default for Element[src]

impl Spanned for Element[src]

impl SpannedWithSourceFile 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.