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

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 layouts: RefCell<LayoutVec>,
    pub child_insertion_point: RefCell<Option<ElementRc>>,
    pub setup_code: RefCell<Vec<Expression>>,
    pub used_global: RefCell<Vec<Rc<Component>>>,
    pub used_structs: RefCell<Vec<Type>>,
    pub popup_windows: RefCell<Vec<PopupWindow>>,
}

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.

layouts: RefCell<LayoutVec>

All layouts in this component

child_insertion_point: RefCell<Option<ElementRc>>

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_global: RefCell<Vec<Rc<Component>>>

All the globals used by this component and its children. FIXME: can we have cycle?

used_structs: RefCell<Vec<Type>>popup_windows: RefCell<Vec<PopupWindow>>

Implementations

impl Component[src]

pub fn from_node(
    node: Component,
    diag: &mut FileDiagnostics,
    tr: &TypeRegister
) -> Rc<Self>
[src]

pub fn is_global(&self) -> bool[src]

This component is a global component introduced with the "global" keyword

Trait Implementations

impl Debug for Component[src]

impl Default for Component[src]

Auto Trait Implementations

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.